Pausing the game
As compelling as your next game will be, you should always let players pause it for a short break. In this recipe, we will implement a simple and effective pause screen including controls for changing the display's quality settings.
For this recipe, we have prepared a package named
BallGame containing a playable scene. The package is in the
How to do it...
To pause your game upon pressing the Esc key, follow these steps:
- Import the
BallGamepackage into your project and, from the Project view, open the level named
- In the Inspector, create a new tag Ball, apply this tag to prefab
Prefabsfolder, and save the scene.
- From the Hierarchy view, use the Create drop-down menu to add a Panel ...