Skip to content

Instantly share code, notes, and snippets.

@openroomxyz
Created May 4, 2020 12:01
Show Gist options
  • Save openroomxyz/f44a1bbacc1225409e074fe537f22368 to your computer and use it in GitHub Desktop.
Save openroomxyz/f44a1bbacc1225409e074fe537f22368 to your computer and use it in GitHub Desktop.
Unity : How to close the game on esc key?
//Works only in build game, does not work when run inside editor
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment