AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HoloToolkit.Unity.TimerScheduler Class Reference

A scheduler that manages various timers. More...

Inheritance diagram for HoloToolkit.Unity.TimerScheduler:
HoloToolkit.Unity.Singleton< TimerScheduler >

Public Member Functions

delegate void Callback ()
 
Timer StartTimer (float timeSeconds, Callback callback, bool loop=false, bool deferred=false)
 Creates a new timer event which will be added next frame. More...
 
void StopTimer (Timer timerId)
 Disable an active timer. More...
 
bool IsTimerActive (Timer timerId)
 

Protected Member Functions

override void Awake ()
 Base Awake method that sets the Singleton's unique instance. Called by Unity when initializing a MonoBehaviour. Scripts that extend Singleton should be sure to call base.Awake() to ensure the static Instance reference is properly created. More...
 
- Protected Member Functions inherited from HoloToolkit.Unity.Singleton< TimerScheduler >
virtual void OnDestroy ()
 Base OnDestroy method that destroys the Singleton's unique instance. Called by Unity when destroying a MonoBehaviour. Scripts that extend Singleton should be sure to call base.OnDestroy() to ensure the underlying static Instance reference is properly cleaned up. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from HoloToolkit.Unity.Singleton< TimerScheduler >
static void AssertIsInitialized ()
 
static bool ConfirmInitialized ()
 Awake and OnEnable safe way to check if a Singleton is initialized. More...
 
- Properties inherited from HoloToolkit.Unity.Singleton< TimerScheduler >
static T Instance [get]
 Returns the Singleton instance of the classes type. If no instance is found, then we search for an instance in the scene. If more than one instance is found, we throw an error and no instance is returned. More...
 
static bool IsInitialized [get]
 Returns whether the instance has been initialized or not. More...
 

Detailed Description

A scheduler that manages various timers.

private int myTimer = 0;
private void MyTimerCallback()
{
// Do stuff
}
private void StartMyTimer()
{
float durationInSec = 0.5f;
myTimer = TimerId.Start(durationInSec, MyTimerCallback);
}
private void StopMyTimer()
{
myTimer.Stop();
}

Definition at line 33 of file TimerScheduler.cs.

Member Function Documentation

§ Awake()

override void HoloToolkit.Unity.TimerScheduler.Awake ( )
protectedvirtual

Base Awake method that sets the Singleton's unique instance. Called by Unity when initializing a MonoBehaviour. Scripts that extend Singleton should be sure to call base.Awake() to ensure the static Instance reference is properly created.

Reimplemented from HoloToolkit.Unity.Singleton< TimerScheduler >.

Definition at line 64 of file TimerScheduler.cs.

§ Callback()

delegate void HoloToolkit.Unity.TimerScheduler.Callback ( )

§ IsTimerActive()

bool HoloToolkit.Unity.TimerScheduler.IsTimerActive ( Timer  timerId)

Definition at line 238 of file TimerScheduler.cs.

§ StartTimer()

Timer HoloToolkit.Unity.TimerScheduler.StartTimer ( float  timeSeconds,
Callback  callback,
bool  loop = false,
bool  deferred = false 
)

Creates a new timer event which will be added next frame.

Parameters
timeSeconds
callback
loop
deferredDeferred timers will be pushed to the priority queue during next update

Definition at line 199 of file TimerScheduler.cs.

§ StopTimer()

void HoloToolkit.Unity.TimerScheduler.StopTimer ( Timer  timerId)

Disable an active timer.

Parameters
timerId
Returns

Definition at line 212 of file TimerScheduler.cs.


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