Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. 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:
    533
    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:
    106
    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:
    533
    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:
    38
  5. McDev02

    McDev02

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