// Start is called before the first frame update private void Awake() { SceneCoordinator sceneCoordinator = FindObjectOfType <SceneCoordinator>(); if (sceneCoordinator == this && SceneCoordinator.instance == null) { instance = this; } else { Destroy(this.gameObject); return; } startingScene = gameObject.scene; startingSceneName = startingScene.name; //StartCoroutine(LoadYourAsyncScene()); if (scenes == null) { scenes = new List <Scene>(); } for (int i = 1; i < SceneManager.sceneCountInBuildSettings; i++) { SceneManager.LoadScene(i, LoadSceneMode.Additive); scenes.Add(SceneManager.GetSceneByBuildIndex(i)); foreach (var item in SceneManager.GetSceneByBuildIndex(i).GetRootGameObjects()) { Debug.Log("Boefsdfds"); item.transform.position += Vector3.right * (-40.0f + (1.0f * (float)i)); item.SetActive(false); } } for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++) { scenes.Add(SceneManager.GetSceneAt(i)); } }
private void Start() { sceneCoordinator = FindObjectOfType <SceneCoordinator>(); }
public void SetNewPage(int buildIndex) { SceneCoordinator.SetNewScene(buildIndex); }