use of com.gemserk.commons.artemis.components.ParentComponent in project commons-gdx by gemserk.
the class HierarchySystem method removed.
@Override
protected void removed(Entity entity) {
ParentComponent parentComponent = entity.getComponent(ParentComponent.class);
// if for some reason the entity parent component was removed before this method was called
if (parentComponent == null)
return;
entity.removeComponent(parentComponent);
ArrayList<Entity> children = parentComponent.getChildren();
for (int i = 0; i < children.size(); i++) {
Entity child = children.get(i);
world.deleteEntity(child);
}
}
Aggregations