Is it possible to know in the Editor that OnDestroy()
is triggered because the scene is closing?
IOW I want to differentiate it from the case when OnDestroy()
is triggered due to removing an object from the scene.
I tried to subscribe to EditorSceneManager.sceneClosing
to set a flag and then use it in OnDestroy()
but this event didn’t work.