Documentation

Unity Engine

Download Unity

Unity Engine

Create(DiscreteTimeInterval, WrapMode, float)

Creates a playing timer at the start of a range.
Read time 1 minuteLast updated 4 hours ago

Definition

public static TimerState Create(DiscreteTimeInterval range, WrapMode wrapMode, float cycleOffset = 0)

Parameters

The time range of the timer.

wrapMode

How the timer treats time outside of
range
.

cycleOffset

The point of the cycle where the timer starts, as a fraction of the duration of
range
. Only WrapMode.Loop uses it.

Returns

Type

Description

TimerStateThe new timer.

Remarks

The timer has a TimerState.TimeScale of 1, and is rewound with TimerStateExtensions.Rewind, so the cycle offset applies when the wrap mode is WrapMode.Loop. The first TimerStateExtensions.Update advances it. To create the timer of a clip, use Clip.ToTimerState.