void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         PauseSystem.Pause();
     }
 }
Beispiel #2
0
    IEnumerator ShowGameOverScreen()
    {
        yield return(new WaitForSeconds(1));

        PauseSystem pauseSystem = GetComponent <PauseSystem>();

        pauseSystem.Pause();
        audioSource.Play();
        audioSource.loop = false;
        gameOverPanel.SetActive(true);
    }
 public void Pause()
 {
     if (_pause)
     {
         PauseSystem.Pause();
         _pause = false;
     }
     else
     {
         PauseSystem.Resume();
         _pause = true;
     }
 }