File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,14 @@ void animationManager::ToggleAnimation()
133133 // Initialize time if not already
134134 if (!this ->CurrentTimeSet )
135135 {
136- this ->CurrentTime = this ->TimeRange [0 ];
136+ if (this ->AnimationMode == AnimationModeType::BACKWARD )
137+ {
138+ this ->CurrentTime = TimeRange[1 ];
139+ }
140+ else
141+ {
142+ this ->CurrentTime = TimeRange[0 ];
143+ }
137144 this ->CurrentTimeSet = true ;
138145 }
139146 }
@@ -182,8 +189,9 @@ void animationManager::Tick()
182189 break ;
183190 case AnimationModeType::BACKWARD :
184191 this ->AnimationDirection = -1 ;
185- this ->CurrentTime = this ->TimeRange [0 ] +
186- modulo (this ->CurrentTime - this ->TimeRange [0 ], this ->TimeRange [1 ] - this ->TimeRange [0 ]);
192+ this ->CurrentTime = this ->TimeRange [1 ] -
193+ modulo (this ->TimeRange [1 ] - this ->CurrentTime , this ->TimeRange [1 ] - this ->TimeRange [0 ]);
194+ break ;
187195 default :
188196 this ->AnimationDirection = 1 ;
189197 this ->CurrentTime = this ->TimeRange [0 ] +
@@ -204,6 +212,7 @@ void animationManager::Tick()
204212 if (this ->AnimationMaxRepeat != -1 && this ->AnimationCurrentRepeat == this ->AnimationMaxRepeat )
205213 {
206214 this ->Playing = false ;
215+ this ->AnimationCurrentRepeat = 0 ;
207216 }
208217}
209218
You can’t perform that action at this time.
0 commit comments