Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Is there an EditorApplication Exit Event?

Discussion in 'Extensions & OnGUI' started by McDev02, Apr 23, 2018.

  1. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    571
    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.
     
  2. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    133
    Shot in the dark, but maybe if you have an [ExecuteInEditMode] which shows a dialogbox in the OnDestroy() ?
     
  3. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    571
    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.
     
  4. StylishCoding

    StylishCoding

    Joined:
    Apr 21, 2018
    Posts:
    106
  5. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    571
    Great thanks, now I just have to wait for the first stable version.