Class Timer
Runs a timer and outputs elapsed and remaining measurements.
Syntax
[UnitCategory("Time")]
[UnitOrder(7)]
public sealed class Timer : Unit, IUnit, IGraphElementWithDebugData, IGraphElementWithData, IGraphElement, IGraphItem, INotifiedCollectionItem, IDisposable, IPrewarmable, IAotStubbable, IIdentifiable, IAnalyticsIdentifiable, IGraphEventListener
Properties
completed
Called when the timer completes.
Declaration
[DoNotSerialize]
public ControlOutput completed { get; }
Property Value
duration
The total duration of the timer.
Declaration
[DoNotSerialize]
public ValueInput duration { get; }
Property Value
elapsedRatio
The proportion of the duration that has elapsed (0-1).
Declaration
[DoNotSerialize]
[PortLabel("Elapsed %")]
public ValueOutput elapsedRatio { get; }
Property Value
elapsedSeconds
The number of seconds elapsed since the timer started.
Declaration
[DoNotSerialize]
[PortLabel("Elapsed")]
public ValueOutput elapsedSeconds { get; }
Property Value
pause
Trigger to pause the timer.
Declaration
[DoNotSerialize]
public ControlInput pause { get; }
Property Value
remainingRatio
The proportion of the duration remaining until the timer is elapsed (0-1).
Declaration
[DoNotSerialize]
[PortLabel("Remaining %")]
public ValueOutput remainingRatio { get; }
Property Value
remainingSeconds
The number of seconds remaining until the timer is elapsed.
Declaration
[DoNotSerialize]
[PortLabel("Remaining")]
public ValueOutput remainingSeconds { get; }
Property Value
resume
Trigger to resume the timer.
Declaration
[DoNotSerialize]
public ControlInput resume { get; }
Property Value
start
The moment at which to start the timer.
If the timer is already started, this will reset it.
If the timer is paused, this will resume it.
Declaration
[DoNotSerialize]
public ControlInput start { get; }
Property Value
started
Called when the timer is started.co
Declaration
[DoNotSerialize]
public ControlOutput started { get; }
Property Value
tick
Called each frame while the timer is active.
Declaration
[DoNotSerialize]
public ControlOutput tick { get; }
Property Value
toggle
Trigger to toggle the timer.
If it is idle, it will start.
If it is active, it will pause.
If it is paused, it will resume.
Declaration
[DoNotSerialize]
public ControlInput toggle { get; }
Property Value
unscaledTime
Whether to ignore the time scale.
Declaration
[DoNotSerialize]
[PortLabel("Unscaled")]
public ValueInput unscaledTime { get; }
Property Value
Methods
CreateData()
Declaration
public IGraphElementData CreateData()
Returns
Implements
Definition()
Declaration
protected override void Definition()
Overrides
IsListening(GraphPointer)
Declaration
public bool IsListening(GraphPointer pointer)
Parameters
Returns
Implements
StartListening(GraphStack)
Declaration
public void StartListening(GraphStack stack)
Parameters
Implements
StopListening(GraphStack)
Declaration
public void StopListening(GraphStack stack)
Parameters
Implements
Update(Flow)
Declaration
public void Update(Flow flow)
Parameters
Type |
Name |
Description |
Flow |
flow |
|
Extension Methods