示例#1
0
        public void OnMainMenuPressed()
        {
            Time.timeScale = 1;
            SceneManager.LoadScene(mainMenuIndex);

            MainMenu.Open();
        }
示例#2
0
        public void OnMainMenuPressed()
        {
            Time.timeScale = 1;
            LevelLoader.LoadMainMenuLevel();

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

            MainMenu.Open();
        }
示例#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();
        }
 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!");
     }
 }
示例#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!");
            }
        }
示例#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");
            }
        }
        // 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!");
            }
        }
示例#10
0
 public void OnMainMenuPressed()
 {
     LevelLoader.LoadMainMenuLevel();
     MainMenu.Open();
 }
示例#11
0
 public void OnMainMenuPressed()
 {
     SwitchPages();
     LevelLoader.instance.LoadMainMenuLevel();
     MainMenu.Open();
 }
示例#12
0
 // return to MainMenu scene
 public void OnMainMenuPressed()
 {
     LevelLoader.LoadMainMenuLevel();
     MainMenu.Open();
     _active = false;
 }