Exemple #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (isTutorialDone)
            {
                if (GameManager.instance.currGameStatus == eGameStatus.play)
                {
                    //if (GameManager.instance.currGameMode != eGameMode.vServerMulltiPlayer)
                    {
                        //pausePanel.SetActive (true);
                        //GameManager.instance.currGameStatus = eGameStatus.pause;
                        //Time.timeScale = 0;
                        gamePlayUI.OnBackClicked();
                    }
//					else {
//					GameManager.instance.currGameStatus = eGameStatus.none;
//					pausePanel.SetActive (false);
//					gamePlayUI.gameObject.SetActive (false);
//					mainMenuUI.gameObject.SetActive (true);
//					ConnectionManager.Instance.OnGameOverSendData ();
//					Time.timeScale = 1;
//				}
                }
                if (GameManager.instance.currGameStatus == eGameStatus.pause)
                {
                    pauseMenuUI.OnClickResume();
                    AdsHandler.Instance.ShowInterstitialPauseAds();
                }
                if (GameManager.instance.currGameStatus == eGameStatus.setting)
                {
                    mainMenuUI.OnClickBackSetting();
                }
                if (GameManager.instance.currGameStatus == eGameStatus.playerselection)
                {
                    mainMenuUI.PlayerSelectionBack();
                }
                if (GameManager.instance.currGameStatus == eGameStatus.mainmenu || GameManager.instance.currGameStatus == eGameStatus.gameover)
                {
                    ExitPanleActive();
                }
            }
//			if (GameManager.instance.currGameStatus == eGameStatus.exit) {
//				OnClickNo ();
//			}
        }
    }