I'm trying to wrap my head around how to create a container style destructor.
onDestroy for the top level object should cause children objects to get destroyed by their onDestroy.
Calling DestroyInstance(inst) seems to do nothing, and not remove the objects i called it on, but inst.OnDestroy() gets rid of the objects as i wish. My fear is that using OnDestroy() this way is going to break things somehow, but i'm not sure how? It'd be nice if someone who knew what would happen could help out.
How should I go about this ? Another option i tried was calling DestroyInstance, then ClearDeathRowForSingleInstance(inst,inst.type), but i'm not completely sure this is a good idea either, what are the side effects if any?
I understand the issue is that destroyinstance doesn't work inside an ondestroy for whatever reason, but what is that reason?
Also i remember DestroyInstance(inst) previously working in this context