Application.Quit works fine when running outside the editor but...

…can I script the editor to stop playing when I choose ‘exit’ from my menu GUI?

I know I can check to see if the editor is currently playing but I didn’t see anything regarding changing the playback state…

Thanks

Application.Quit only works for standalones. It won’t work for the editor, webplayer, or mobile. I don’t believe that you can access the editor’s status at all, but I may be mistaken.

I know this post is old, but if someone looks for the information, you actually can stop playing a game in-editor, using the following line :
UnityEditor.EditorApplication.isPlaying = false;

7 Likes