Example #1
0
    private void PauseGame()
    {
        // Pause the game state
        m_GameState = GameState.Paused;

        //Show the pause menu
        m_UI.ShowPauseMenu();
        //Show the cursor
        Cursor.visible = true;
        //Unlock the mouse
        Cursor.lockState = CursorLockMode.None;

        //set the time scale to stop
        Time.timeScale = 0.0f;

        //stop the players mouse look movement - player movement is handled by timescale and doesn't need to be stopped manually.
        m_Player.GetComponent <MouseLook>().Pause();
    }