I am looking for an equivalent to OnApplicationQuit() for the Unity Editor, is this possible?
I want to show an OK/Cancle Message at that point to remind myself to commit my changes to GIT.
Shot in the dark, but maybe if you have an [ExecuteInEditMode] which shows a dialogbox in the OnDestroy() ?
I tried it with an editor window as all other types may not be Destroyed or have to be in the scene and it doesn’t work as I’d assume that OnDestroy is not called or Unity just forces to quit.
I also tried other things like Finalizers but no chance.
An equivalent to EditorApplication.update += EditorUpdate; for OnExit would be nice.
Unity 2018 added two event about quitting:
1 Like
Great thanks, now I just have to wait for the first stable version.
I’ve just tried this, and EditorApplication.wantsToQuit is never called. I used the example from the page (and there’s nothing wrong with the code), and it is simply ignored.