Created
May 4, 2020 12:01
-
-
Save openroomxyz/f44a1bbacc1225409e074fe537f22368 to your computer and use it in GitHub Desktop.
Unity : How to close the game on esc key?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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