Пример #1
0
    // 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));
        }
    }
Пример #2
0
 private void Start()
 {
     sceneCoordinator = FindObjectOfType <SceneCoordinator>();
 }
Пример #3
0
 public void SetNewPage(int buildIndex)
 {
     SceneCoordinator.SetNewScene(buildIndex);
 }