Replacing Application.Quit() with UnityEditor.EditorApplication.ExitPlaymode()

Regarding Feedback & Bug Fixes lecture: instead of using Application.Quit() it will be useful to show to students the method UnityEditor.EditorApplication.ExitPlaymode(). It will work in the Unity Editor, and students will see the result immediately. Also there can be used more complicated way using preprocessor directives, like this:
#if UNITY_EDITOR
UnityEditor.EditorApplication.ExitPlaymode();
#else
Application.Quit();
#endif

Thanks for sharing! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms