public void EndLevel(int levelIndex) { PersistData(); if (!died) { // print(SceneManager.GetActiveScene().name); // print("NOT DIED: " + claveScore); UnlockNextLevel(levelIndex); if (levelIndex == 4) { LevelChanger.FindObjectOfType <LevelChanger>().FadeToLevel(5); } else { LevelChanger.FindObjectOfType <LevelChanger>().FadeToLevel(0); // Load the MainScene with Fade. } } else { // Loads the GameOver Scene: LevelChanger.FindObjectOfType <LevelChanger>().FadeToLevel(6); // Load the GameOver Scene with Fade. } }
private void LoadMainScreen() { LevelChanger.FindObjectOfType <LevelChanger>().FadeToLevel(0); }
private void LoadPreviousLevel() { LevelChanger.FindObjectOfType <LevelChanger>().FadeToLevel(FindObjectOfType <GameManager>().currentLevel); }