fix: mobile animation

This commit is contained in:
cha0s 2021-04-19 11:05:09 -05:00
parent 0546abbf08
commit 20d3daebc3

View File

@ -95,6 +95,21 @@ export default () => class Mobile extends decorate(Trait) {
}
}
listeners() {
return {
isMobileChanged: () => {
if (!this.entity.isMobile || Vector.isZero(this.actionMovement)) {
this.entity.currentAnimation = 'idle';
}
else {
this.entity.currentAnimation = 'moving';
}
},
};
}
methods() {
return {