Beispiel #1
0
 public void OnMenuClick()
 {
     GameState.unlockNewLevel = false;
     CUtils.BackScene(menuIndex);
     Sound.instance.PlayButton();
     Close();
 }
Beispiel #2
0
 //回到上一个场景
 public void BackLastScene()
 {
     if (SceneManager.GetActiveScene().buildIndex == Const.SCENE_HOME)
     {
         scene.Clear();
         Application.Quit();
         return;
     }
     // int index = (int)sceneStack.Pop ();
     if (scene.Count > 0)
     {
         int index = scene[scene.Count - 1];
         //如果是主菜单场景,直接返回home
         if (SceneManager.GetActiveScene().buildIndex == Const.SCENE_MAP)
         {
             scene.Clear();
             CUtils.BackScene(Const.SCENE_HOME);
             return;
         }
         else if (SceneManager.GetActiveScene().buildIndex == Const.SCENE_DAILY)
         {
             scene.Clear();
             CUtils.BackScene(Const.SCENE_HOME);
             return;
         }
         scene.RemoveAt(scene.Count - 1);
         CUtils.BackScene(index, this);
     }
 }
Beispiel #3
0
 public void OnQuitClick()
 {
     // Application.Quit();
     Close();
     GameState.unlockNewLevel = false;
     CUtils.BackScene(Const.SCENE_HOME);
 }