I am making an Editor plugin that communicates with a native plugin made with C++. I am required to notify the native plugin when Editor is about to be closed. I spent few hours on Unity's doc looking for an event or callback function that can be used to detect when Editor closes but I couldn't find one.
Usually, OnApplicationQuit
, OnApplicationPause
and OnApplicationFocus
are used for something like this on standalone build but this is for the Editor so it wouldn't work
Does anyone know about any function or event to do this? If this there no built-in solution to do, is there a hack or some other ways to do this?
There is no native way to detect the shutdown of the editor it self.
However, you possibly could hook up to the proccess itself and wait for the exited event as described in this answer.
But if possible you will want to do this on the c++ side itself instead.
C++, How to determine if a Windows Process is running?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With