CCTask
CCTask
Cocos2DInheritance: System.Object
Methods
BlockOnUIThread(Action)
BlockOnUIThread(Action)(System.Action action)
Runs the given action on the UI thread and blocks the current thread while the action is running. If the current thread is the UI thread, the action will run immediately.
Parameters:
action
(System.Action) - The action to be run on the UI threadExample
EnsureUIThread()
EnsureUIThread()()
Throws an exception if the code is not currently running on the UI thread.
Example
IsOnUIThread()
System.Boolean IsOnUIThread()()
Checks if the code is currently running on the UI thread.
Returns:
System.Boolean
- true if the code is currently running on the UI thread.Example
RunAsync(Action)
System.Object RunAsync(Action)(System.Action action)
Parameters:
action
(System.Action)Returns:
System.Object
RunAsync(Action, Action)
System.Object RunAsync(Action, Action)(System.Action action, System.ActionSystem.Object taskCompleted)
Parameters:
action
(System.Action)taskCompleted
(System.ActionSystem.Object)Returns:
System.Object
RunOnScheduler(Action)
RunOnScheduler(Action)(System.Action action)
Parameters:
action
(System.Action)RunOnUiThread(Action)
RunOnUiThread(Action)(System.Action action)
Parameters:
action
(System.Action)