Observer event BEFORE entity is deleted
-
I'm currently working on a plugin which makes cutout components cut double faces. What I'm doing is creating a cutout component for the opposite face.
What I'm trying to do now is sync these two components. Currently, if I move one, the other moves with it. I have added a reference to each other by adding an attribute dictionary so that I can reattach the observes across sessions.
However, when one is deleted, I'd like to move the other. But, when the
onEraseEntity
is fired the entity is already deleted and I can't access the attribute dictionary any more. Is there any way to be notified about the deletion of an entity before it's actually deleted?
Or will I have to keep an extra hash which references the linked components? -
hrmm... I tried using an extra hash to keep a reference list. But as it turns out, the entity that
onEraseEntity
returns doesn't match the ones I've stored...
Advertisement