- Home /
The question is answered, right answer was accepted
onExit, onQuit, or anything like that?
Is there any way to always have a function run on application exit?
I was just about to put something that works when I call Application.Quit() from in the game when the player clicks to quit, but then...
I realized I don't know how to trap whether they are using the exit button on a windowed screen and not one of my own exit buttons from in the game.
Anyone know how to trap an exit to do something right before it quits out (set a registry variable for instance), no matter how the user quits out?
Just FYI, you can never handle when the user kills the process via the Task $$anonymous$$anager (or via Force Quit on OSX). The "OnApplicationQuit" and "CancelQuit" events/properties are definitely what you're looking for, though.
What about EditorApplication.OnExit, is that too much to ask?
Answer by Tetrad · Jun 25, 2010 at 04:46 AM
both of you guys basically had helpful answers but I can only tag one as the right one so I did the first one submitted. Thanks for the help!
that is funny. because I see the comment, but i also see two answers tagged as correct...