44-Quit Application with the Escape Key
While it may seem intuitive to press the Escape key to quit the game, this function does not come naturally, it needs to be coded by the game developer.
Take this game, for example, we can add a few lines in our GameManager script and tell the application to quit once receiving the user’s input of the escape key, that is:
Voila, now when the game opens in full window mode, we will be able to quit the game by following our old habit, pressing the Escape key.
However, it should be noted that this function cannot be tested in the Unity Editor; it will only work when we actually build and run the game.