Class MainThreadManagedInvokeAction
Helper class for easy invoking managed code on main thread before all game systems update.
Assembly: FlaxEngine.dll
File: Engine/Scripting/Internal/MainThreadManagedInvokeAction.h
Syntax
public class MainThreadManagedInvokeAction : public MainThreadTask
Constructors
MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel)
Declaration
public MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel)
Parameters
|
MObject
instance
|
|
MMethod
method
|
|
LogType
exceptionLevel
|
MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel, const ParamsBuilder& params)
Declaration
public MainThreadManagedInvokeAction(MObject* instance, MMethod* method, LogType exceptionLevel, const ParamsBuilder& params)
Parameters
|
MObject
instance
|
|
MMethod
method
|
|
LogType
exceptionLevel
|
|
ParamsBuilder
params
|
MainThreadManagedInvokeAction(void* methodThunk, LogType exceptionLevel, const ParamsBuilder& params)
Declaration
public MainThreadManagedInvokeAction(void* methodThunk, LogType exceptionLevel, const ParamsBuilder& params)
Parameters
|
void
methodThunk
|
|
LogType
exceptionLevel
|
|
ParamsBuilder
params
|
Methods
Invoke(MMethod* method, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Starts the new task or invokes this action now if already running on a main thread.
Declaration
public static MainThreadManagedInvokeAction* Invoke(MMethod* method, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Parameters
|
MMethod
method
The managed method. |
|
MObject
instance
The managed instance object. |
|
LogType
exceptionLevel
The exception logging error level. |
Returns
|
MainThreadManagedInvokeAction
The created task. |
Invoke(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Starts the new task or invokes this action now if already running on a main thread.
Declaration
public static MainThreadManagedInvokeAction* Invoke(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Parameters
|
MMethod
method
The managed method. |
|
ParamsBuilder
params
The method parameters. |
|
MObject
instance
The managed instance object. |
|
LogType
exceptionLevel
The exception logging error level. |
Returns
|
MainThreadManagedInvokeAction
The created task. |
Invoke(void* methodThunk, ParamsBuilder& params, LogType exceptionLevel=LogType::Error)
Starts the new task or invokes this action now if already running on a main thread.
Declaration
public static MainThreadManagedInvokeAction* Invoke(void* methodThunk, ParamsBuilder& params, LogType exceptionLevel=LogType::Error)
Parameters
|
void
methodThunk
The managed method thunk (must return void and has up to 4 parameters). |
|
ParamsBuilder
params
The method parameters. |
|
LogType
exceptionLevel
The exception logging error level. |
Returns
|
MainThreadManagedInvokeAction
The created task. |
InvokeNow(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Invokes action now.
Declaration
public static void InvokeNow(MMethod* method, ParamsBuilder& params, MObject* instance=nullptr, LogType exceptionLevel=LogType::Error)
Parameters
|
MMethod
method
The managed method. |
|
ParamsBuilder
params
The method parameters. |
|
MObject
instance
The managed instance object. |
|
LogType
exceptionLevel
The exception logging error level. |
Run()
Runs the task specified operations. It does not handle any task related logic, but only performs the actual job.
Declaration
protected virtual bool Run() override
Returns
|
bool
The task execution result. Returns true if failed, otherwise false. |