Rewind(ref TimerState)
Rewinds a timer state to the start of its range.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
Rewind(TimerState)
public static void Rewind(this ref TimerState timerState)
Parameters
The timer state to rewind. The method changes this timer state.
Remarks
The method moves TimerState.PreviousTime and TimerState.Time to the start of TimerState.Range and sets TimerState.DeltaTime to zero. It doesn't change TimerState.PlayState, so a playing timer keeps playing.
When the wrap mode is WrapMode.Loop, the method also applies TimerState.CycleOffset. The time moves by the cycle offset times the duration of the range, and wraps back into the range. The method sets TimerState.PreviousLoopCount and TimerState.LoopCount to the cycle offset rounded down to a whole number. For example, with a range from to , a cycle offset of sets TimerState.Time to and both loop counts to , and a cycle offset of sets to and both loop counts to . With any other wrap mode, the time stays at the start of the range and the method sets both loop counts to .
021.250.51-0.25Time1.5-10