Skip to content

Instantly share code, notes, and snippets.

@inutamago-dogegg
Last active July 17, 2023 10:06
Show Gist options
  • Save inutamago-dogegg/8f581b2b51034ac7855727676e3368eb to your computer and use it in GitHub Desktop.
Save inutamago-dogegg/8f581b2b51034ac7855727676e3368eb to your computer and use it in GitHub Desktop.
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
private static void QuitGame() {
#if (UNITY_EDITOR)
EditorApplication.isPlaying = false;
#elif (UNITY_STANDALONE)
Application.Quit();
#elif (UNITY_WEBGL)
Application.OpenURL("about:blank");
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment