Meta SDK2 Beta  2.7.0
Meta.UnityThreadedJob Class Reference

Runs a function in a thread, and waits for it. Then call a finish event in the unity thread. More...

Inheritance diagram for Meta.UnityThreadedJob:
Meta.ThreadedJob

Public Member Functions

void Dispose ()
 Cleans resourses. More...
 
void RunFunction (System.Action threadAction, System.Action doneAction)
 Runs a function in the thread from. doneAction will be called when the thread is ready. More...
 
IEnumerator RunFunctionFromGameObject (System.Action action, System.Action doneAction)
 Runs a function in the thread from a gameObject. doneAction will be called when the thread is ready. More...
 
- Public Member Functions inherited from Meta.ThreadedJob
virtual void Start ()
 Creates and start a new thread. More...
 
virtual void Abort ()
 Abort the current thread. More...
 

Protected Member Functions

override void ThreadFunction ()
 Thread function that will run in the thread. More...
 

Additional Inherited Members

- Properties inherited from Meta.ThreadedJob
bool IsDone [get, set]
 Whether the thread function is done or not. More...
 

Detailed Description

Runs a function in a thread, and waits for it. Then call a finish event in the unity thread.

Member Function Documentation

◆ Dispose()

void Meta.UnityThreadedJob.Dispose ( )
inline

Cleans resourses.

◆ RunFunction()

void Meta.UnityThreadedJob.RunFunction ( System.Action  threadAction,
System.Action  doneAction 
)
inline

Runs a function in the thread from. doneAction will be called when the thread is ready.

Parameters
threadActionThe function to be run in a thread.
doneActionEvent that occurs when the threadAction is done.

◆ RunFunctionFromGameObject()

IEnumerator Meta.UnityThreadedJob.RunFunctionFromGameObject ( System.Action  action,
System.Action  doneAction 
)
inline

Runs a function in the thread from a gameObject. doneAction will be called when the thread is ready.

Parameters
threadActionThe function to be run in a thread.
doneActionEvent that occurs when the threadAction is done.

◆ ThreadFunction()

override void Meta.UnityThreadedJob.ThreadFunction ( )
inlineprotectedvirtual

Thread function that will run in the thread.

Implements Meta.ThreadedJob.