@@ -107,8 +107,6 @@ export class Animator extends Component {
107
107
this . _reset ( ) ;
108
108
}
109
109
110
- this . _playFrameCount = this . engine . time . frameCount ;
111
-
112
110
const stateInfo = this . _getAnimatorStateInfo ( stateName , layerIndex ) ;
113
111
const { state, layerIndex : playLayerIndex } = stateInfo ;
114
112
@@ -128,6 +126,7 @@ export class Animator extends Component {
128
126
animatorLayerData . layerState = LayerState . Playing ;
129
127
animatorLayerData . srcPlayData . reset ( state , animatorStateData , state . _getDuration ( ) * normalizedTimeOffset ) ;
130
128
129
+ this . _playFrameCount = this . engine . time . frameCount ;
131
130
this . update ( 0 ) ;
132
131
}
133
132
@@ -149,7 +148,11 @@ export class Animator extends Component {
149
148
manuallyTransition . duration = normalizedTransitionDuration ;
150
149
manuallyTransition . offset = normalizedTimeOffset ;
151
150
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
+ }
153
156
}
154
157
155
158
/**
@@ -994,8 +997,6 @@ export class Animator extends Component {
994
997
this . _reset ( ) ;
995
998
}
996
999
997
- this . _playFrameCount = this . engine . time . frameCount ;
998
-
999
1000
if ( ! crossState ) {
1000
1001
return false ;
1001
1002
}
@@ -1036,7 +1037,6 @@ export class Animator extends Component {
1036
1037
1037
1038
animatorLayerData . crossFadeTransition = transition ;
1038
1039
1039
- this . update ( 0 ) ;
1040
1040
return true ;
1041
1041
}
1042
1042
0 commit comments