Assets/Scripts/Menu/PlayButton.cs
/// <summary>
/// CheckRotation() contains the logic for how the menu camera rotates when switching out between paused and playing
/// rotateCam is true when the game is playing and false when the game is paused
/// Game is unpaused/paused as the camera finishes moving towards its destination
/// </summary>
CheckRotation() contains the logic for how the menu camera rotates when switching out between paused and playing
rotateCam is true when the game is playing and false when the game is paused
Game is unpaused/paused as the camera finishes moving towards its destination
CheckRotation () contains the logic for how the menu camera rotates when switching out between paused and playing rotateCam is true when the game is playing and false when the game is paused Game is unpaused / paused as the camera finishes moving towards its destination
void CheckRotation()
    {
        if (menuCam.transform.rotation.x > 0 && rotateCam)
        {
            menuCam.transform.rotation = Quaternion.RotateTowards(menuCam.transform.rotation, Quaternion.Euler(0, mainCam.transform.rotation.y, mainCam.transform.rotation.z), 90f * Time.deltaTime);
        }
        else if (menuCam.transform.rotation.x < 90 && !rotateCam)
        {
            GameManager.paused = true;
            menuCam.transform.rotation = Quaternion.RotateTowards(menuCam.transform.rotation, Quaternion.Euler(90, 0, 0), 90f * Time.deltaTime);
        }
        else if (rotateCam && menuCam.transform.rotation.x < 1 && GameManager.paused)
        {
            GameManager.paused = false;
        }
        else if (!rotateCam && menuCam.transform.rotation.x > 1 && !GameManager.paused)
        {
            GameManager.paused = true;
        }
    }
void CheckRotation ( ) { if ( menuCam . transform . rotation . x > 0 && rotateCam ) { menuCam . transform . rotation = Quaternion . RotateTowards ( menuCam . transform . rotation , Quaternion . Euler ( 0 , mainCam . transform . rotation . y , mainCam . transform . rotation . z ) , 90f * Time . deltaTime ) ; } else if ( menuCam . transform . rotation . x < 90 && ! rotateCam ) { GameManager . paused = true ; menuCam . transform . rotation = Quaternion . RotateTowards ( menuCam . transform . rotation , Quaternion . Euler ( 90 , 0 , 0 ) , 90f * Time . deltaTime ) ; } else if ( rotateCam && menuCam . transform . rotation . x < 1 && GameManager . paused ) { GameManager . paused = false ; } else if ( ! rotateCam && menuCam . transform . rotation . x > 1 && ! GameManager . paused ) { GameManager . paused = true ; } }
CheckRotation() contains the logic for how the menu camera rotates when switching out between paused and playing
rotateCam is true when the game is playing and false when the game is paused
Game is unpaused/paused as the camera finishes moving towards its destination
CheckRotation () contains the logic for how the menu camera rotates when switching out between paused and playing rotateCam is true when the game is playing and false when the game is paused Game is unpaused / paused as the camera finishes moving towards its destination