using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SceneChanger : MonoBehaviour { //private void OnEnable() //{ // PassTheEdgeTrigger.OnPassingTheEdge += ChangeScene; //} //private void OnDisable() //{ // PassTheEdgeTrigger.OnPassingTheEdge -= ChangeScene; //} public void ChangeScene() { StartCoroutine("ChangeNow"); } private IEnumerator ChangeNow() { yield return new WaitForSeconds(1); //Prescene MazeGeneration //SceneManager.LoadScene("MazeGeneration"); //Prescene RealPyramid //SceneManager.LoadScene("RealPyramidCameraOrbit"); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } }