fix switch clip cause baked animation frame index to -1 (#14322)

This commit is contained in:
zhakesi
2023-02-21 15:34:08 +08:00
committed by GitHub
parent 5e9192d87b
commit 7af1b4b3c5
@@ -487,8 +487,9 @@ export class JointAnimationInfo {
public switchClip (info: IAnimInfo, clip: AnimationClip | null) {
info.currentClip = clip;
info.data[0] = -1;
info.data[0] = 0; // reset default frame 0
info.buffer.update(info.data);
info.data[0] = -1; // reset frame index to -1. sampleCurves will calculate frame to 0.
info.dirty = false;
if (JSB) {
info.dirtyForJSB[0] = 0;