November 2017
Beginner to intermediate
360 pages
6h 40m
English
Now that we have the main menu finished, let's continue doing this with the pause menu:
/// <summary> /// Will turn our pause menu on or off /// </summary> /// <param name="isPaused"></param> public void SetPauseMenu(bool isPaused) { paused = isPaused; // If the game is paused, timeScale is 0, otherwise 1 Time.timeScale = (paused) ? 0 : 1; if(paused) { SlideMenuIn(pauseMenu); } else { SlideMenuOut(pauseMenu); } }
Note that because PauseMenuBehaviour inherits from MainMenuBehaviour, it also can call the SlideMenuIn and SlideMenuOut functions, respectively, as long as ...