Question : How to quit unity app
Answered by : programming-doggo
#if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false;
#else Application.Quit();
#endif
Source : | Last Update : Sun, 07 Nov 21
Question : unity Exit application
Answered by : doubtful-dormouse-lqto4hnxef60
public void QuitGame() { // save any game data here #if UNITY_EDITOR // Application.Quit() does not work in the editor so // UnityEditor.EditorApplication.isPlaying need to be set to false to end the game UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif }
Source : https://www.codegrepper.com/app/answer.php | Last Update : Sat, 28 Aug 21