Skip to content

Instantly share code, notes, and snippets.

@CodeSmile-0000011110110111
Created March 5, 2023 10:45
Show Gist options
  • Save CodeSmile-0000011110110111/413742107f003fdc2cc133bc84e666f4 to your computer and use it in GitHub Desktop.
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
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