Fixing "none" animation does not exist log
This commit is contained in:
parent
8fb9053412
commit
05fbcad252
@ -50,9 +50,10 @@ export const getPlayerAnimations = (name: string = Textures.Player): AnimationDa
|
||||
};
|
||||
|
||||
export const playAnimation = (Player : Phaser.GameObjects.Sprite, direction : string) => {
|
||||
if (!Player.anims.currentAnim || Player.anims.currentAnim.key !== direction) {
|
||||
if (direction !== PlayerAnimationNames.None && (!Player.anims.currentAnim || Player.anims.currentAnim.key !== direction)) {
|
||||
Player.anims.play(direction);
|
||||
} else if (direction === PlayerAnimationNames.None && Player.anims.currentAnim) {
|
||||
Player.anims.currentAnim.destroy();
|
||||
//Player.anims.currentAnim.destroy();
|
||||
Player.anims.stop();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user