The Escape Button is a Feature
Objective: Learn how to implement the quit functionality on the escape key.
So we have our game published, we have an executable for it, but at the current moment, the players cannot exit our game. They can, but only if the game is played on the Windowed mode, if played on Fullscreen, the player cannot do anything to go back to their desktop.

Lucky for us, Unity has an easy way to fix this. We can add a functionality to our Escape key, that quits the application if the player presses it.
Application.Quit();
This command cannot be used in the editor, ’cause its specific to builds. This will effectively shut your game down and close the current window its in.
This is the functionality we wanted, so how do we implement this ?
Well, we had created a Game Manager, which manages the state of the game. Inside this class, we can check if the player pressed the Escape key, and if so, we exit the application.
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
}
Now with this implementation, when the player presses Escape, it will tell Unity to quit the application!