Oh No! I’m Stuck in Fullscreen Mode
The Escape Button is a Feature
In one of my past articles, I mentioned keeping the screen size in Windowed mode when building the project, because I hadn’t yet implemented a way to ‘ESCAPE’ fullscreen mode. Now it’s time to do just that. I want to be able to play in Fullscreen and be able to exit Fullscreen at the press of a key. For this section, I’m going to have the Escape key exit the whole application and not just exit Fullscreen mode.
All we have to do is add some code to our “GameManager” script.
- Add the following code inside the Update () method.
That’s it! Now when you press the Escape key at anytime while the application is open, the application will close. Stay tuned. There’s more to this than meets the eye.