Documentation

Unity Engine

Download Unity

Unity Engine

ToTimerState(DiscreteTime)

Creates a timer for the clip, positioned at a time from the start of the clip.
Read time 1 minuteLast updated 4 hours ago

Definition

public readonly TimerState ToTimerState(DiscreteTime time)

Parameters

The time, in seconds, to advance the timer by from the start of the clip. A negative time goes backward.

Returns

Type

Description

TimerStateThe timer of the clip, advanced by
time
.

Remarks

The timer is a clip timer. Its TimerState.Time is the time on the clip curves, including the cycle offset. Its TimerState.LoopCount counts the wraps of the clip. Pass it to TimerStateExtensions.Update every frame to play the clip.
The timer has the following values:
The timer doesn't snap the time to the frames of the clip. To play a clip backward, set a negative TimerState.TimeScale on the timer.