Skip to content

Instantly share code, notes, and snippets.

@LaserKaspar
Created November 30, 2021 10:05
Show Gist options
  • Save LaserKaspar/e7490caf90b7a5e0ade75d866d61b566 to your computer and use it in GitHub Desktop.
Save LaserKaspar/e7490caf90b7a5e0ade75d866d61b566 to your computer and use it in GitHub Desktop.
(UnityEngine) Quit a running game.
public void QuitGame()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment