Skip to content

Commit 9c3510b

Browse files
committed
feat: revert to transition modification
1 parent 3505273 commit 9c3510b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/core/src/animation/Animator.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ export class Animator extends Component {
107107
this._reset();
108108
}
109109

110-
this._playFrameCount = this.engine.time.frameCount;
111-
112110
const stateInfo = this._getAnimatorStateInfo(stateName, layerIndex);
113111
const { state, layerIndex: playLayerIndex } = stateInfo;
114112

@@ -128,6 +126,7 @@ export class Animator extends Component {
128126
animatorLayerData.layerState = LayerState.Playing;
129127
animatorLayerData.srcPlayData.reset(state, animatorStateData, state._getDuration() * normalizedTimeOffset);
130128

129+
this._playFrameCount = this.engine.time.frameCount;
131130
this.update(0);
132131
}
133132

@@ -149,7 +148,11 @@ export class Animator extends Component {
149148
manuallyTransition.duration = normalizedTransitionDuration;
150149
manuallyTransition.offset = normalizedTimeOffset;
151150
manuallyTransition.destinationState = state;
152-
this._crossFadeByTransition(manuallyTransition, playLayerIndex);
151+
152+
if (this._crossFadeByTransition(manuallyTransition, playLayerIndex)) {
153+
this._playFrameCount = this.engine.time.frameCount;
154+
this.update(0);
155+
}
153156
}
154157

155158
/**
@@ -994,8 +997,6 @@ export class Animator extends Component {
994997
this._reset();
995998
}
996999

997-
this._playFrameCount = this.engine.time.frameCount;
998-
9991000
if (!crossState) {
10001001
return false;
10011002
}
@@ -1036,7 +1037,6 @@ export class Animator extends Component {
10361037

10371038
animatorLayerData.crossFadeTransition = transition;
10381039

1039-
this.update(0);
10401040
return true;
10411041
}
10421042

0 commit comments

Comments
 (0)