Adding a pause menu
When playing games, especially mobile games, there may come a time when you need to stop playing them at any moment. Having a pause menu will allow our players the convenience of deciding when they want to stop the game in its current state and resume it at a time that is convenient for them. This will also allow us to dive into some additional concepts in using Unity’s UI system, so with that in mind, let’s start building one:
- Open up the Gameplay scene by going to the Project window, opening the
Assets/Scenes
folder, and double-clicking on Gameplay, saving the MainMenu level if you didn’t do so already:
Figure 4.30 – Opening the Gameplay scene
Before we worry about how we are going to open our pause menu, let’s go ahead and create the pause menu that we’ll be opening first.
- The first thing we’ll do is dim our screen when we enter the pause menu. An easy way to do...