private static void RunNextTask() { var nextTaskWrapper = currentTask?.GetCurrentTask(); if (nextTaskWrapper == null || currentTask.cancelled) { currentTask = null; nextTaskWrapper = null; if (queuedTasks.Count > 0) { currentTask = queuedTasks.Dequeue(); nextTaskWrapper = currentTask?.GetCurrentTask(); } } if (nextTaskWrapper != null) { TaskManagerController.QueueTask(nextTaskWrapper); } }
public static bool IsBusy() { var currentTaskWrapper = currentTask?.GetCurrentTask(); return(currentTaskWrapper != null && !currentTask.cancelled && TaskManagerController.HasTask(currentTaskWrapper)); }