fix: method
This commit is contained in:
parent
0681b3a998
commit
f124cc07c5
|
@ -163,11 +163,6 @@ export default (flecks) => class Animated extends decorate(Trait) {
|
|||
}
|
||||
},
|
||||
|
||||
setAnimationRate: (rate) => {
|
||||
this.#animations[this.#currentAnimation].frameRate = rate;
|
||||
this.#forceUpdate = true;
|
||||
},
|
||||
|
||||
startedDying: () => {
|
||||
this.isAnimating = false;
|
||||
},
|
||||
|
@ -217,6 +212,17 @@ export default (flecks) => class Animated extends decorate(Trait) {
|
|||
this.#currentAnimation = this.state.currentAnimation;
|
||||
}
|
||||
|
||||
methods() {
|
||||
return {
|
||||
setAnimationRate: (rate) => {
|
||||
if (this.#animations[this.#currentAnimation].frameRate !== rate) {
|
||||
this.#animations[this.#currentAnimation].frameRate = rate;
|
||||
this.#forceUpdate = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
offsetFor(key) {
|
||||
if (!(key in this.params.animations) || !this.params.animations[key].offset) {
|
||||
return [0, 0];
|
||||
|
|
Loading…
Reference in New Issue
Block a user