NRSDKApiForUnity
Classes
XRXREALXREALMainThreadDispather
Unity.XR.XREAL.XREALMainThreadDispather
Inheritance diagram for Unity.XR.XREAL.XREALMainThreadDispather:
Unity.XR.XREAL.SingletonMonoBehaviour< T >

Public Member Functions

void QueueOnMainThread (Action action)
 
CancellationTokenSource QueueOnMainThreadWithDelay (Action action, float delaySeconds)
 

Events

static Action OnUpdate
 

Additional Inherited Members

- Static Public Member Functions inherited from Unity.XR.XREAL.SingletonMonoBehaviour< T >
static T CreateSingleton ()
 
- Properties inherited from Unity.XR.XREAL.SingletonMonoBehaviour< T >
static T Singleton [get]
 

Detailed Description

A singleton MonoBehaviour class that dispatches actions to be executed on the Unity main thread.

Member Function Documentation

◆ QueueOnMainThread()

void Unity.XR.XREAL.XREALMainThreadDispather.QueueOnMainThread ( Action action)

Queues an action to be executed on the Unity main thread in the next frame.

Parameters
actionThe action to execute on the main thread.

◆ QueueOnMainThreadWithDelay()

CancellationTokenSource Unity.XR.XREAL.XREALMainThreadDispather.QueueOnMainThreadWithDelay ( Action action,
float delaySeconds )

Queues an action to be executed on the Unity main thread after a specified delay. Returns a CancellationTokenSource that can be used to cancel the scheduled action.

Parameters
actionThe action to execute on the main thread.
delaySecondsThe delay in seconds before the action is executed.
Returns
A CancellationTokenSource that can be used to cancel the scheduled action.