TimerAction - CodingDino/Dino-Unity-Toolkit GitHub Wiki

The TimerAction component controls a FloatData and counts either up or down each frame that it is active.

The TimerAction component might be used impose a cooldown on player abilities, spawn objects or enemies, provide an overall time limit for a level, or track how long it takes the player to complete a level to serve as a scoring system.

This is an Action component, and therefore must be triggered by a separate Activator component. Actions, Activators, and Data make up the core system for the Dino Unity Toolkit.

Image: TimerAction set to count upwards when activated.

Image: TimerAction controlling a FloatData along with a UITextAction to display a countdown.

Note: The timer will not start by default. Try using an InitializationActivator if you want it to start right away.

Properties

Property: Description:
Count Mode Should the timer count up or count down?

Actions

This component has several Action functions that can be triggered by Activators.

ActionStartTimer()

This action starts the timer running. Once running, it will update the connected FloatData component every frame, either adding or subtracting the time passed that frame.

ActionStopTimer()

This action stops the timer. Until started again, it will not updated the FloatData component.