FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
EventTimer Class Referenceabstract

A base class timer that either invokes a UnityEvent when time elapses or resets when an interrupt happens. More...

Inheritance diagram for EventTimer:
IdleTimer

Public Attributes

UnityEvent OnTimerElapsed
 Inspector, Code
Calls the function(s) subscribed to this UnityEvent when the timer has elapsed.
 

Protected Member Functions

bool CheckForInterrupt ()
 Checks for an interrupt condition to determine if the timer will reset.
 
virtual void Start ()
 Invokes the FAST.EventTimer.OnTimerElapsed event if FAST.EventTimer.triggerOnStart is set to true.
 
virtual IEnumerator Timer ()
 The Coroutine function that waits for the timer to elapse and then invokes the FAST.EventTimer.OnTimerElapsed event.
 
virtual void Update ()
 Calls FAST.EventTimer.CheckForInterrupt() to determine if the timer will reset.
 

Protected Attributes

float timerSeconds = 120f
 Inspector
The duration of the timer in seconds.
 
bool triggerOnStart = false
 Inspector
Set to true if the FAST.EventTimer.OnTimerElapsed event should be invoked during FAST.EventTimer.Start().
 

Detailed Description

A base class timer that either invokes a UnityEvent when time elapses or resets when an interrupt happens.

See also
UnityEngine.Events.UnityEvent
UnityEngine.Coroutine

Member Function Documentation

◆ CheckForInterrupt()

bool CheckForInterrupt ( )
abstractprotected

Checks for an interrupt condition to determine if the timer will reset.

Returns
true if the timer will reset, false if the timer will keep going or not reset.

◆ Start()

virtual void Start ( )
protectedvirtual

Invokes the FAST.EventTimer.OnTimerElapsed event if FAST.EventTimer.triggerOnStart is set to true.

Reimplemented in IdleTimer.

◆ Timer()

virtual IEnumerator Timer ( )
protectedvirtual

The Coroutine function that waits for the timer to elapse and then invokes the FAST.EventTimer.OnTimerElapsed event.

◆ Update()

virtual void Update ( )
protectedvirtual

Calls FAST.EventTimer.CheckForInterrupt() to determine if the timer will reset.

Member Data Documentation

◆ OnTimerElapsed

UnityEvent OnTimerElapsed

Inspector, Code
Calls the function(s) subscribed to this UnityEvent when the timer has elapsed.

◆ timerSeconds

float timerSeconds = 120f
protected

Inspector
The duration of the timer in seconds.

◆ triggerOnStart

bool triggerOnStart = false
protected

Inspector
Set to true if the FAST.EventTimer.OnTimerElapsed event should be invoked during FAST.EventTimer.Start().


The documentation for this class was generated from the following file: