I found an interesting problem with the DisplayPanel systems.
During Initialize(), I am registering a number of events handlers in some display panels - I use ScriptableObjects for messaging and so these event handlers are registered with those SOs. However, these panels are disabled by default, and so if I destroy the panel manager during scene transitions without having opened those those child panels, I am unable to de-register those event handlers. This is because Unity doesn't call OnDestroy() if an object is never enabled. This means that if I fire those events later, there are references to destroyed objects and Unity craps the bed.
Having a "Deactivate" counterpart to Initialize (which should be fired OnDestory() on the display panel manager I think?) would allow me clean-up those panels between scene transitions, even if they were never enabled. I've handled this with some other custom components at this time, but the approach smells. Please consider my request.
And thank you. Your asset is really awesome. It's worth every penny and helps make my dreams as a hobby solo-dev realizable.
During Initialize(), I am registering a number of events handlers in some display panels - I use ScriptableObjects for messaging and so these event handlers are registered with those SOs. However, these panels are disabled by default, and so if I destroy the panel manager during scene transitions without having opened those those child panels, I am unable to de-register those event handlers. This is because Unity doesn't call OnDestroy() if an object is never enabled. This means that if I fire those events later, there are references to destroyed objects and Unity craps the bed.
Having a "Deactivate" counterpart to Initialize (which should be fired OnDestory() on the display panel manager I think?) would allow me clean-up those panels between scene transitions, even if they were never enabled. I've handled this with some other custom components at this time, but the approach smells. Please consider my request.
And thank you. Your asset is really awesome. It's worth every penny and helps make my dreams as a hobby solo-dev realizable.