// Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            PauseMenuManager.GoToMenu(MenuName.Pause);                  // Activate pause menu when escape key is pressed
        }


        if (EventManager.NumberOfBlocks == 0 && gameOver == false)            // Display gameover screen when all blocks are destroyed
        {
            Time.timeScale = 0;
            gameOver       = true;
            Instantiate(Resources.Load("GameOver"));
        }
    }
Ejemplo n.º 2
0
 public void HandleQuitButtonOnClickEvent()
 {
     Time.timeScale = 1;                                     // Go tomain menu on click of of quit button
     Destroy(this.gameObject);
     PauseMenuManager.GoToMenu(MenuName.Return);
 }