You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the hierarchy implementation I need a way to detect both deleted entities and components (I don't think I need to disambiguate however, just when any Parent or entity that had a Parent is deleted).
The ideal case would be to have a separate deleted filter that would also give me that last set Component value. I could see this being problematic in terms of leaking memory however.
Hmmm. Yeah this is a tricky one. Ideal case is to iterate through (or receive events for) entities with a query like: 'read the PreviousParent components for any deleted entity with a Parent and PreviousParent, or any entity that has a deleted Parent component).
The more I think of it though, the more can-of-worms this gets. If you have an API to provide component data after it has been 'deleted', then the potential to leak memory seems significant. All the user has to do is forget to consume all the events.
Another way to work around this for my use-case (I think Unity ECS might do this too, actually) would be:
Collect a set of 'known' entity IDs by querying for all Children components.
Iterate through all Parent and PreviousParent components to compare what was removed from the hierarchy.
I don't think that would require remove events at all but might be more costly.
For the hierarchy implementation I need a way to detect both deleted entities and components (I don't think I need to disambiguate however, just when any
Parent
or entity that had aParent
is deleted).The ideal case would be to have a separate
deleted
filter that would also give me that last set Component value. I could see this being problematic in terms of leaking memory however.Tagging @jaynus here too.
The text was updated successfully, but these errors were encountered: