chore: clean stuff up
This commit is contained in:
parent
0710ff875d
commit
c1a90b941b
|
@ -239,6 +239,7 @@ export class Entity extends decorate(Resource) {
|
|||
for (const eventName in listeners) {
|
||||
this.off(eventName, listeners[eventName]);
|
||||
}
|
||||
instance._memoizedListeners = {};
|
||||
// Remove state.
|
||||
this.state = this.state.delete(type);
|
||||
// Remove instance.
|
||||
|
|
|
@ -39,6 +39,7 @@ export class Pictured extends decorate(Trait) {
|
|||
sprite.image.destroy();
|
||||
sprite.destroy();
|
||||
}
|
||||
this.sprites = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,15 @@ class AnimatedBase extends Trait {
|
|||
const animationView = this.animationViews[key];
|
||||
animationView.destroy();
|
||||
}
|
||||
this.animationViews = undefined;
|
||||
}
|
||||
for (const key in this.animations) {
|
||||
const animation = this.animations[key];
|
||||
animation.destroy();
|
||||
}
|
||||
this.animations = {};
|
||||
this.animationsPromise = undefined;
|
||||
this._cachedAabbs = {};
|
||||
}
|
||||
|
||||
hideAnimation(key) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user