Class Dispatcher
Represents a system for dispatching Actions to execute on the Main Thread.
Inherited Members
Namespace: TriLibExporter
Assembly: Assembly-CSharp.dll
Syntax
public class Dispatcher : MonoBehaviour
Properties
DontDestroyOnLoad
Gets/Sets whether the Dispatcher instance will be destroyed when a new level is loaded.
Declaration
public static bool DontDestroyOnLoad { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
CheckInstance()
Ensures a Dispatcher instance exists.
Declaration
public static void CheckInstance()
ExecuteQueue(IAssetWriterContext)
Executes the actions in the given queue and waits for its execution, handling the async and sync calls automatically.
Declaration
public static void ExecuteQueue(IAssetWriterContext assetWriterContext)
Parameters
Type | Name | Description |
---|---|---|
IAssetWriterContext | assetWriterContext | TODO |
ExecuteRecursively(IEnumerator)
Executes the given enumerator recursively.
Declaration
public static void ExecuteRecursively(IEnumerator enumerator)
Parameters
Type | Name | Description |
---|---|---|
IEnumerator | enumerator | The enumerator to execute. |
InvokeAsync(Action)
Queues an action to be invoked on the Main Thread.
Declaration
public static void InvokeAsync(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | The Action to be queued on the Main Thread. |
InvokeAsyncAndWait<T>(Action<T>, T)
Queues an action to be invoked on the Main Thread and waits for its execution, handling the async and sync calls automatically.
Declaration
public static void InvokeAsyncAndWait<T>(Action<T> action, T context) where T : class, IAwaitable, IAssetWriterContext
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | The Action to be queued on the Main Thread. |
T | context | The Context to be assigned to the Action. |
Type Parameters
Name | Description |
---|---|
T |
InvokeAsyncUnchecked<T>(Action<T>, T)
Queues an action to be invoked on the Main Thread.
Declaration
public static void InvokeAsyncUnchecked<T>(Action<T> action, T context)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | The Action to be queued on the Main Thread. |
T | context | The Context to be assigned to the Action. |
Type Parameters
Name | Description |
---|---|
T |
InvokeAsync<T>(Action<T>, T)
Queues an action to be invoked on the Main Thread, handling the async and sync calls automatically.
Declaration
public static void InvokeAsync<T>(Action<T> action, T context) where T : IAssetWriterContext
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | The Action to be queued on the Main Thread. |
T | context | The Context to be assigned to the Action. |
Type Parameters
Name | Description |
---|---|
T |