Skip to content

Commit

Permalink
Call removeObject3DComponent when using removeAllComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong committed Sep 10, 2020
1 parent fa16406 commit e0f47da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ export class ECSYThreeEntity extends _Entity {
obj.entity = null;
}

removeAllComponents(forceImmediate) {
if (this.hasComponent(Object3DComponent)) {
this.removeObject3DComponent();
}

return super.removeAllComponents(forceImmediate);
}

remove(forceImmediate) {
if (this.hasComponent(Object3DComponent)) {
const obj = this.getObject3D();
Expand Down

0 comments on commit e0f47da

Please sign in to comment.