Interface IMainThreadCommandHandler
Interface for basic handler of main thread commands.
Namespace: InsaneScatterbrain.Threading
Syntax
public interface IMainThreadCommandHandler
Methods
Cancel()
Stops executing the command as soon as possible.
Declaration
void Cancel()
Queue(IMainThreadCommand, bool)
Declaration
void Queue(IMainThreadCommand command, bool waitForCompletion = true)
Parameters
Type | Name | Description |
---|---|---|
IMainThreadCommand | command | |
bool | waitForCompletion |
Queue(Action, bool)
Queues the command for executing on the next update.
Declaration
[Obsolete("This overload will likely be removed in 2.0.")]
void Queue(Action action, bool waitForCompletion = true)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
bool | waitForCompletion | Whether or not the calling thread should wait for completion of this command before continuing code execution. |
Update()
Executes all queued commands on the main thread. If they're done, they are removed from the queue.
Declaration
void Update()