Skip to content

Commit

Permalink
Fix setAnimation can not work normally at cache mode while animation'…
Browse files Browse the repository at this point in the history
…s name different with default. (#16603)
  • Loading branch information
bofeng-song authored Dec 13, 2023
1 parent 91dd0c7 commit c44eb3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cocos/spine/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ export class Skeleton extends UIRenderer {
let cache = this._skeletonCache.getAnimationCache(this._skeletonData!.uuid, name);
if (!cache) {
cache = this._skeletonCache.initAnimationCache(this.skeletonData!.uuid, this._skeletonData!, name);
cache?.setSkin(this._skinName);
}
if (cache) {
this._animationName = name;
Expand Down Expand Up @@ -996,6 +997,7 @@ export class Skeleton extends UIRenderer {
this._animCache.setSkin(name);
}
}
this._skinName = name;
this.invalidAnimationCache();
}

Expand Down

0 comments on commit c44eb3d

Please sign in to comment.