Unity.XR.XREAL.XREALMainThreadDispather
Inheritance diagram for Unity.XR.XREAL.XREALMainThreadDispather:
Public Member Functions | |
void | QueueOnMainThread (Action action) |
CancellationTokenSource | QueueOnMainThreadWithDelay (Action action, float delaySeconds) |
Events | |
static Action | OnUpdate |
Additional Inherited Members | |
static T | CreateSingleton () |
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
-
action The 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
-
action The action to execute on the main thread. delaySeconds The delay in seconds before the action is executed.
- Returns
- A CancellationTokenSource that can be used to cancel the scheduled action.