Ejemplo n.º 1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (!gameOver && !gameWon)
            {
                gameOver = true;
            }
            else
            {
                Cursor.visible   = true;
                Cursor.lockState = CursorLockMode.None;
                SceneManager.LoadScene("Main_Menu");
            }
        }

        if (currentTerritory.GetEnemiesRemaining() == 0)
        {
            gameWon = true;
        }

        if (gameOver || gameWon)
        {
            Time.timeScale = 0;
        }
    }