Exemplo n.º 1
0
    void PauseGame(bool _pause)
    {
        if (!playerUI)
        {
            playerUI = GameManager.instance.SpawnedPlayer.UI;
        }

        if (_pause)
        {
            playerUI.PauseMenuSetActive(true);

            if (freezeOnPause)
            {
                Time.timeScale = 0;
            }
        }

        else
        {
            playerUI.PauseMenuSetActive(false);

            if (freezeOnPause)
            {
                Time.timeScale = 1;
            }
        }
    }