Why does my game not quit after executing "Application.Quit()"?
After selecting the menu entry "quit game" and pressing enter, I call this line of code:
Debug.Log("Exit Game.");
Application.Quit();
I get the message Exit Game.
But the game does not quit. Why?
Answer by Hatsuko · Oct 27, 2017 at 01:55 PM
Please look at this post since I can't say anything more clearly. Also I remembered I had similar questions too. It turns out that there's some functions that only works in Editor, some only works in Player (= your built application). For example there's a EditorApplication.isPaused. While I was reading it I thought "Oh cool so that's how I pause the game?" so I called EditorApplication.isPaused = true;
in my game's pause menu. It turned out that It didn't work as I expected. Come to think about it, Application.Quit()
means "Quit the built application (not quit/stop the Editor)" and EditorApplication.isPaused = true;
means "Pause the Editor (not pause the built application)".
Your answer
Follow this Question
Related Questions
Problem with Application.Quit 2 Answers
[iOS] Foce quit, then reopen => 10 seconds freeze, then app restarts 1 Answer
How to quit game in unity 1 Answer
How do I get my Quit button to reset the score? 0 Answers
Quit Game button will not work 2 Answers