Class SlowTaskModule
Manages tasks that run at regular intervals
Inheritance
Implements
Inherited Members
Namespace: Unity.MARS.MARSUtils
Assembly: Unity.MARS.dll
Syntax
[MovedFrom("Unity.MARS")]
public class SlowTaskModule : ScriptableSettings<SlowTaskModule>, IModuleBehaviorCallbacks, IModuleMarsUpdate, IModule, IProvidesSlowTasks, IFunctionalityProvider
Methods
AddMarsTimeSlowTask(Action, float, bool)
Registers the given task and starts it running at regular intervals based on MARS time
Declaration
public bool AddMarsTimeSlowTask(Action action, float sleepTime, bool replace = false)
Parameters
Type | Name | Description |
---|---|---|
Action | action | |
float | sleepTime | The amount of time to wait between executions |
bool | replace | (Optional) Whether this should replace existing parameters
for |
Returns
Type | Description |
---|---|
bool | True if the task has not already been added or if |
AddSlowTask(Action, float, bool)
Registers the given task and starts it running at regular intervals based on game time
Declaration
public bool AddSlowTask(Action action, float sleepTime, bool replace = false)
Parameters
Type | Name | Description |
---|---|---|
Action | action | |
float | sleepTime | The amount of time to wait between executions |
bool | replace | (Optional) Whether this should replace existing parameters
for |
Returns
Type | Description |
---|---|
bool | True if the task has not already been added or if |
ClearTasks()
Declaration
public void ClearTasks()
RemoveMarsTimeSlowTask(Action)
Unregisters the given MARS-time task and stops running it
Declaration
public bool RemoveMarsTimeSlowTask(Action task)
Parameters
Type | Name | Description |
---|---|---|
Action | task | The task to remove |
Returns
Type | Description |
---|---|
bool | True if the task was successfully found and removed, false otherwise |
RemoveSlowTask(Action)
Unregisters the given task and stops running it
Declaration
public bool RemoveSlowTask(Action task)
Parameters
Type | Name | Description |
---|---|---|
Action | task | The task to remove |
Returns
Type | Description |
---|---|
bool | True if the task was successfully found and removed, false otherwise |