public void OnMainMenuPressed() { Time.timeScale = 1; SceneManager.LoadScene(mainMenuIndex); MainMenu.Open(); }
public void OnMainMenuPressed() { Time.timeScale = 1; LevelLoader.LoadMainMenuLevel(); MainMenu.Open(); }
public void OnReturnToMainPressed() { Time.timeScale = 1; // Return to Main Menu LevelLoader.LoadMainMenuLevel(); MainMenu.Open(); }
// unpauses and loads the MainMenu level public void OnMainMenuPressed() { Time.timeScale = 1; LevelLoader.LoadMainMenuLevel(); MainMenu.Open(); _active = false; PlayerInformationController.Instance.UpdateZones("MainMenu"); }
public void OnMainMenuPressed() { LevelLoader.LoadLevel(mainMenuIndex); if (DataManager.Instance) { DataManager.Instance.Save(); } MainMenu.Open(); }
public static void LoadLevel(int levelIndex) { if (levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings) { if (levelIndex == LevelLoader.mainMenuIndex) { MainMenu.Open(); } SceneManager.LoadScene(levelIndex); } else { Debug.LogWarning("LEVELLOADER LoadLevel Error: invalid scene specified!"); } }
//public void LoadLevel(string levelName) //{ // if (Application.CanStreamedLevelBeLoaded(levelName)) // { // SceneManager.LoadScene(levelName); // } // else // { // Debug.LogWarning("LEVELLOADER Loadlevel Error: invalid scene specified!"); // } //} public void LoadLevel(int levelIndex) { if (levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings) { if (levelIndex == mainMenuIndex) { MainMenu.Open(); } StartCoroutine(LoadLevelAsync(levelIndex)); //SceneManager.LoadScene(levelIndex); } else { Debug.LogWarning("LEVELLOADER Loadlevel Error: invalid scene specified!"); } }
/// <summary> /// Loads a scene by its build index /// </summary> /// <param name="levelIndex"></param> public static void LoadLevel(int levelIndex) { if (levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings) { // if the scene to load matches the index of the main menu scene, // open the main menu if (levelIndex == _mainMenuIndex) { MainMenu.Open(); } SceneManager.LoadScene(levelIndex); } else { Debug.LogWarning("LevelLoader.LoadLevel(int) Error: invalid scene index"); } }
// loads a level by index public static void LoadLevel(int levelIndex) { // if the index is valid... if (levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings) { // open the MainMenu if the index is the mainMenuIndex if (levelIndex == LevelLoader.mainMenuIndex) { MainMenu.Open(); } // load the scene by index SceneManager.LoadScene(levelIndex); } else { Debug.LogWarning("LEVELLOADER LoadLevel Error: invalid scene specified!"); } }
public void OnMainMenuPressed() { LevelLoader.LoadMainMenuLevel(); MainMenu.Open(); }
public void OnMainMenuPressed() { SwitchPages(); LevelLoader.instance.LoadMainMenuLevel(); MainMenu.Open(); }
// return to MainMenu scene public void OnMainMenuPressed() { LevelLoader.LoadMainMenuLevel(); MainMenu.Open(); _active = false; }