Skip to Content
Unity 2017 Mobile Game Development
book

Unity 2017 Mobile Game Development

by John P. Doran
November 2017
Beginner to intermediate content levelBeginner to intermediate
360 pages
6h 40m
English
Packt Publishing
Content preview from Unity 2017 Mobile Game Development

Adding Tweens to the pause menu

Now that we have the main menu finished, let's continue doing this with the pause menu:

  1. Go ahead and open up our Gameplay scene. Update the PauseScreenBehaviour script to have the following implementation of SetPauseMenu:
/// <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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Holistic Mobile Game Development with Unity

Holistic Mobile Game Development with Unity

Penny de Byl
Hands-On Unity 2020 Game Development

Hands-On Unity 2020 Game Development

Nicolas Alejandro Borromeo

Publisher Resources

ISBN: 9781787288713Supplemental Content