Created
March 5, 2023 10:45
-
-
Save CodeSmile-0000011110110111/413742107f003fdc2cc133bc84e666f4 to your computer and use it in GitHub Desktop.
Add functionality to quit a running Unity build by pressing Escape 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
using UnityEngine; | |
namespace CodeSmile | |
{ | |
public class PressEscapeToQuit : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
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