Skip to content

Class Manus::Utility::UnityMainThreadDispatcher

ClassList > Manus > Utility > UnityMainThreadDispatcher

Inherits the following classes: MonoBehaviour

Public Static Properties

Type Name
property UnityMainThreadDispatcher instance

Public Functions

Type Name
void Enqueue (IEnumerator p_Action)
Locks the queue and adds the IEnumerator to the queue.
void Enqueue (Action p_Action)
Locks the queue and adds the Action to the queue.
Task EnqueueAsync (Action p_Action)
Locks the queue and adds the Action to the queue, returning a Task which is completed when the action completes.

Public Static Functions

Type Name
void Initalize ()
Find or create UnityMainThreadDispatcher.

Public Static Properties Documentation

property instance

UnityMainThreadDispatcher Manus.Utility.UnityMainThreadDispatcher.instance;

Public Functions Documentation

function Enqueue [1/2]

Locks the queue and adds the IEnumerator to the queue.

inline void Manus::Utility::UnityMainThreadDispatcher::Enqueue (
    IEnumerator p_Action
) 

Parameters:

  • p_Action IEnumerator function that will be executed from the main thread.

function Enqueue [2/2]

Locks the queue and adds the Action to the queue.

inline void Manus::Utility::UnityMainThreadDispatcher::Enqueue (
    Action p_Action
) 

Parameters:

  • p_Action function that will be executed from the main thread.

function EnqueueAsync

Locks the queue and adds the Action to the queue, returning a Task which is completed when the action completes.

inline Task Manus::Utility::UnityMainThreadDispatcher::EnqueueAsync (
    Action p_Action
) 

Parameters:

  • p_Action function that will be executed from the main thread.

Returns:

A Task that can be awaited until the action completes

Public Static Functions Documentation

function Initalize

static inline void Manus::Utility::UnityMainThreadDispatcher::Initalize () 

The documentation for this class was generated from the following file api/unity-plugin/Scripts/Utility/UnityMainThreadDispatcher.cs