Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    577
    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:
    140
    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:
    577
    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:
    114
  5. McDev02

    McDev02

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

    Harinezumi

    Joined:
    Jan 7, 2013
    Posts:
    44