File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,17 +19,21 @@ private static bool Prefix(Animator __instance)
1919
2020 __instance . _playback . ClipLength = ( __instance . Clip . Asset ? . Data ? . GlobalDuration ) . GetValueOrDefault ( ) ;
2121
22- if ( ! __instance . _fieldMappersValid )
23- __instance . GenerateFieldMappers ( ) ;
24-
2522 if ( ! _lastPositionByAnimator . TryGetValue ( __instance , out var lastPosition ) )
2623 {
27- // Make sure that initial state is always applied,
24+ // Make sure that initial state is always applied for new animators ,
2825 // since playback position can't be < 0
2926 lastPosition = - 1 ;
3027 _lastPositionByAnimator . Add ( __instance , lastPosition ) ;
3128 }
3229
30+ if ( ! __instance . _fieldMappersValid )
31+ {
32+ // Also make sure that initial state is always applied after the field mappers change
33+ lastPosition . Value = - 1 ;
34+ __instance . GenerateFieldMappers ( ) ;
35+ }
36+
3337 if ( lastPosition != __instance . Position )
3438 {
3539 var position = lastPosition . Value = __instance . Position ;
You can’t perform that action at this time.
0 commit comments