Documentation

Unity Engine

Download Unity

Unity Engine

Update(ref TimerState, DiscreteTime)

Advances a timer by a time step and applies its wrap mode.
Read time 1 minuteLast updated 4 hours ago

Definition

Update(TimerState, DiscreteTime)

public static void Update(this ref TimerState timerState, DiscreteTime deltaTime)

Parameters

timerState

The timer to update. The method changes this timer.

deltaTime

The time step to advance the timer by, before the method multiplies it by TimerState.TimeScale.

Remarks

The method first stores the current TimerState.Time, TimerState.LoopCount, and TimerState.PlayState as the previous values. TimerState.PlayState then takes the value of TimerState.NextPlayState.
If the timer isn't playing, TimerState.DeltaTime is zero and the time doesn't change. Otherwise, TimerState.DeltaTime is
deltaTime
multiplied by TimerState.TimeScale, and the method advances TimerState.Time according to TimerState.WrapMode: