Hey there,
I have a Problem with OnDestroy. So I have boxes which spawn loot which is triggered in the box script via OnDestroy. The loot when being spawn Registers itself to a gridfield on which it has been spawned.
If I Close the application / Stop the Editor Player, I get tons of exception Errors.
The Problem seems to be that when I Close the application, OnDestroy is being triggered which tries to spawn loot which cannot be registered to a gridfield since These also have been destroyed via quitting the application.
Is there any way to check if an application has been quit or not ?
Something like If(!Application.Quit){ do stuff…}