Example #1
0
 public void CheckPause()
 {
     if (Input.GetKeyDown(KeyCode.Escape) || (GameManager.PauseGame && !MenuPause.activeSelf))
     {
         if (GameManager.PauseGame)
         {
             if (objMenu != null)
             {
                 objMenu.ClickResumeGame();
             }
             Resumegame();
             MenuPause.SetActive(false);
         }
         else
         {
             MenuPause.SetActive(true);
             if (objMenu != null)
             {
                 objMenu.ReactivateFocus();
             }
             GameManager.PauseGame = true;
             Time.timeScale        = 0;
         }
     }
     if (!Input.GetKey("space") || Input.GetKeyUp("space"))
     {
         GameManager.BlockKeyBoard = false;
     }
 }