Exemplo n.º 1
0
        public void OnMainMenuPressed()
        {
            Time.timeScale = 1;
            SceneManager.LoadScene(mainMenuIndex);

            MainMenu.Open();
        }
Exemplo n.º 2
0
        public void OnMainMenuPressed()
        {
            Time.timeScale = 1;
            LevelLoader.LoadMainMenuLevel();

            MainMenu.Open();
        }
Exemplo n.º 3
0
        public void OnReturnToMainPressed()
        {
            Time.timeScale = 1;
            // Return to Main Menu
            LevelLoader.LoadMainMenuLevel();

            MainMenu.Open();
        }
Exemplo n.º 4
0
 // 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();
        }
Exemplo n.º 6
0
 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!");
     }
 }
Exemplo n.º 7
0
        //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!");
            }
        }
Exemplo n.º 8
0
        /// <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");
            }
        }
Exemplo n.º 9
0
        // 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!");
            }
        }
Exemplo n.º 10
0
 public void OnMainMenuPressed()
 {
     LevelLoader.LoadMainMenuLevel();
     MainMenu.Open();
 }
Exemplo n.º 11
0
 public void OnMainMenuPressed()
 {
     SwitchPages();
     LevelLoader.instance.LoadMainMenuLevel();
     MainMenu.Open();
 }
Exemplo n.º 12
0
 // return to MainMenu scene
 public void OnMainMenuPressed()
 {
     LevelLoader.LoadMainMenuLevel();
     MainMenu.Open();
     _active = false;
 }