From 6792bc72c158aab3d681eaba260cc2ec2b04ce05 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Thu, 13 Feb 2025 11:52:01 +0100 Subject: [PATCH] [ts][player] Fix state.setAnimation and player.setViewport not working on success callback. --- spine-ts/spine-player/src/Player.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spine-ts/spine-player/src/Player.ts b/spine-ts/spine-player/src/Player.ts index 27f9975a1..2ae8273ea 100644 --- a/spine-ts/spine-player/src/Player.ts +++ b/spine-ts/spine-player/src/Player.ts @@ -561,8 +561,13 @@ export class SpinePlayer implements Disposable { this.setViewport(entry.animation!); this.pause(); } - } else if (!this.currentViewport) { - this.setViewport(entry.animation!); + } else { + if (this.currentViewport.x === undefined) { + this.setViewport(entry.animation!); + } + if (!config.animation) { + config.animation = entry.animation?.name + } this.play(); } }