Class for scheduling Tasks using MelonCoroutines
public static class TaskScheduler
Inheritance System.Object TaskScheduler
Waits for a yield instruction and then completes with an action
public static void ContinueWith<T>(this T yieldInstruction, System.Action<T> onComplete)
where T : YieldInstruction;
T
yieldInstruction T
onComplete System.Action<T>
Schedule a task to execute later on as a Coroutine
public static void ScheduleTask(System.Action action, BTD_Mod_Helper.Api.Enums.ScheduleType scheduleType, int amountToWait, System.Func<bool> waitCondition=null);
action System.Action
The action you want to execute once it's time to run your task
scheduleType ScheduleType
How you want to wait for your task
amountToWait System.Int32
The amount you want to wait
waitCondition System.Func<System.Boolean>
Wait for this to be true before executing task
Schedule a task to execute later on as a Coroutine. By default will wait until the end of this current frame
public static void ScheduleTask(System.Action action, System.Func<bool> waitCondition=null);
action System.Action
The action you want to execute once it's time to run your task
waitCondition System.Func<System.Boolean>
Wait for this to be true before executing task
Schedule a task to execute later on as a Coroutine. By default will wait until the end of this current frame
public static void ScheduleTask(System.Action action, System.Func<bool> waitCondition, System.Func<bool> stopCondition);
action System.Action
The action you want to execute once it's time to run your task
waitCondition System.Func<System.Boolean>
Wait for this to be true before executing task
stopCondition System.Func<System.Boolean>
Stop waiting if this becomes true
Schedule a task to execute right now as a Coroutine
public static void ScheduleTask(System.Collections.IEnumerator iEnumerator);
iEnumerator System.Collections.IEnumerator
This coroutine will wait for amountToWait before finishing
private static System.Collections.IEnumerator WaiterCoroutine(System.Action action, BTD_Mod_Helper.Api.Enums.ScheduleType scheduleType, int amountToWait, System.Func<bool> waitCondition=null, System.Func<bool> stopCondition=null);
action System.Action
scheduleType ScheduleType
amountToWait System.Int32
waitCondition System.Func<System.Boolean>
stopCondition System.Func<System.Boolean>