C# Class UnityMainThreadDispatcher, OpenFace-FACS-Unity-Facial-Animator

A thread-safe class which holds a queue with actions to execute on the next Update() method. It can be used to make calls to the main thread for things such as UI Manipulation in Unity. It was developed for use in combination with the Firebase Unity plugin, which uses separate threads for event handling Adapter from here: https://github.com/PimDeWitte/UnityMainThreadDispatcher
Inheritance: MonoBehaviour
Exibir arquivo Open project: alexismorin/OpenFace-FACS-Unity-Facial-Animator Class Usage Examples

Public Methods

Method Description
Enqueue ( Action, action ) : void

Locks the queue and adds the Action to the queue

Enqueue ( IEnumerator, action ) : void

Locks the queue and adds the IEnumerator to the queue

Exists ( ) : bool
Instance ( ) : UnityMainThreadDispatcher,
Update ( ) : void

Private Methods

Method Description
ActionWrapper ( Action, a ) : IEnumerator,
Awake ( ) : void
OnDestroy ( ) : void

Method Details

Enqueue() public method

Locks the queue and adds the Action to the queue
public Enqueue ( Action, action ) : void
action Action, function that will be executed from the main thread.
return void

Enqueue() public method

Locks the queue and adds the IEnumerator to the queue
public Enqueue ( IEnumerator, action ) : void
action IEnumerator, IEnumerator function that will be executed from the main thread.
return void

Exists() public static method

public static Exists ( ) : bool
return bool

Instance() public static method

public static Instance ( ) : UnityMainThreadDispatcher,
return UnityMainThreadDispatcher,

Update() public method

public Update ( ) : void
return void