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); } } }