Files
TaiWan/Assets/Roaming/Scripts/SceneCollider.cs
2025-10-31 15:20:38 +08:00

16 lines
379 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SceneCollider : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other.name.StartsWith("SceneCollider"))
{
int newIndex = int.Parse(other.name.Substring(13));
SceneLoader.Instance.LoadSceneData(newIndex, null);
}
}
}