Exemplo n.º 1
0
        private void PrepareScene()
        {
            SpawnCamera();
            SpawnWorldUiCanvas();
            sceneSettings = FindObjectOfType <SceneSettings>();
#if (UNITY_EDITOR)
            levelController.StartCurrentEditorLevel();
            if (sceneSettings != null && sceneSettings.levels != null)
            {
                currentLevel = sceneSettings.startLevel;
                levelController.LoadLevel(sceneSettings.GetLevel(currentLevel));
            }
#else
            currentLevel = sceneSettings.startLevel;
            levelController.LoadLevel(sceneSettings.GetLevel(currentLevel));
#endif
            loadingScreen.Hide();
            isLoading = false;
            OnSceneLoaded?.Invoke();
        }
        public void NextLevel()
        {
            currentLevel++;

            GameObject nextLevel = sceneSettings.GetLevel(currentLevel);

            if (nextLevel != null)
            {
                levelController.LoadLevel(nextLevel);
            }
        }