Class Dispatcher
Dispatch execution to the main thread.
Inherited Members
Namespace: UnityEngine.UnitySDK
Assembly: Unity.Pixyz.UnitySDK.Editor.dll
Syntax
public static class Dispatcher
Methods
DelayFrames(int)
Delay frames and dispatch execution to the main thread
Declaration
public static Dispatcher.DelayFramesDispatch DelayFrames(int frames)
Parameters
| Type | Name | Description |
|---|---|---|
| int | frames | number of frames to delay |
Returns
| Type | Description |
|---|---|
| Dispatcher.DelayFramesDispatch | Dispatch |
GoMainThread()
Dispatch execution to the main thread.
Declaration
public static Dispatcher.GoMainThreadDispatch GoMainThread()
Returns
| Type | Description |
|---|---|
| Dispatcher.GoMainThreadDispatch | Dispatch |
GoThreadPool()
Delay frames and dispatch execution to the main thread
Declaration
public static Dispatcher.GoThreadPoolDispatch GoThreadPool()
Returns
| Type | Description |
|---|---|
| Dispatcher.GoThreadPoolDispatch | Dispatch |
SleepForSeconds(float)
Delay frames and dispatch execution to the main thread
Declaration
public static Dispatcher.SleepForSecondsDispatch SleepForSeconds(float seconds)
Parameters
| Type | Name | Description |
|---|---|---|
| float | seconds | Number of seconds to sleep |
Returns
| Type | Description |
|---|---|
| Dispatcher.SleepForSecondsDispatch | Dispatch |
StartCoroutine(IEnumerator)
Starts a coroutine. Similar to Unity's coroutine, except that it can switch threads. Yield instructions to use are all static methods in the Dispatcher class.
Declaration
public static void StartCoroutine(IEnumerator enumerable)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerator | enumerable | Instruction to run |
Update()
Update callback, connected to editor loop and game loop, in order to be able to dispatch instructions in the main thread in editor or play mode.
Declaration
public static void Update()
WaitForSeconds(float)
Delay frames and dispatch execution to the main thread
Declaration
public static Dispatcher.WaitForSecondsDispatch WaitForSeconds(float seconds)
Parameters
| Type | Name | Description |
|---|---|---|
| float | seconds | Number of seconds to wait |
Returns
| Type | Description |
|---|---|
| Dispatcher.WaitForSecondsDispatch | Dispatch |