Skip to content
eisclimber edited this page Apr 4, 2026 · 1 revision

Timer

Class in ExPresSXR.Misc.Timing

Inherits from UnityEngine.MonoBehaviour

Summary

A timer counting down time.

public class Timer : MonoBehaviour

Fields

Name Description
OnPaused Event that is triggered when the timer is paused. The parameter is it is paused or not.
OnStarted Event that is triggered when the timer was started. A started timer automatically be unpaused.
OnTimeout Event that is triggered when the timer times out.

Methods

Name Description
PauseTimer() Pauses the timer if possible.
ResumeTimer() Continues a paused timer or starts the timer using waitTime .
SetTimerPaused(bool) Pauses or unpauses the timer, maintaining it's current waitTime (and not starting it, if not running)
StartTimer(float) (Re-)starts the timer with duration, setting waitTime in the process.
If duration is less or equal to 0.0f the value of waitTime is used.
StartTimerDefault() Starts the timer using waitTime .
Prevents the need to provide a value if invoked via UnityEvents.
StopTimer() Stops and resets the timer whilst not emitting the timeout event.
UnpauseTimer() Unpauses the timer if possible.

Properties

Name Description
AutoStart If true, will start the timer during OnAwake()...
Description A description of the timer. No further use.
OneShot If false, the timer will restart after timeout.
RemainingTime Returns the remaining time of the timer.
If the timer is was not started or timed out, the value will be the value of TIMER_INACTIVE_WAIT_TIME.
Running If the timer is actively is counting down, meaning it was started and is not paused.
TimerPaused If the timer is paused or not.
WaitTime How long the timer takes to timeout. Must be greater than 0.0f.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally