Пример #1
0
 private void PauseGame()
 {
     if (isLevelStarted &&
         Input.GetButtonDown("Cancel"))
     {
         if (Time.timeScale == 1)
         {
             Time.timeScale = 0;
             uiManager.ShowPauseMenu();
             if (SFX_Pause != null)
             {
                 Instantiate(SFX_Pause);
             }
         }
         else
         {
             Time.timeScale = 1;
             uiManager.HidePauseMenu();
             if (SFX_Unpause != null)
             {
                 Instantiate(SFX_Unpause);
             }
         }
     }
 }