// Tells the game to toggle pausing the game and to do anything TO (un)pause the game public void PauseGame() { // If already paused... if (GameCore.pauseState) { // Undarken the screen DarkenScreen.UnBlockScreen(); // Indicate that not paused anymore GameCore.pauseState = false; // Set the game back in motion Time.timeScale = 1; } else // Pause the game { // Darken the screen DarkenScreen.BlockScreen(0.7f); // State that the game is now paused GameCore.pauseState = true; // Officially "pause" the game Time.timeScale = 0; } } // close PauseGame
/* public static bool Fading * { * get { return Instance.m_Fading; } * } */ private void Awake() { // Assign the m_instance to this object m_Instance = this; // Disable the renderer, so it's not blocking anything Instance.renderer.enabled = false; }