/// <summary> /// Creates a new running task /// </summary> public static UnityTask RunOnCurrent <TParam>(Action <TParam> action, TParam param) { var task = new UnityTask(action, param, TaskStrategy.CurrentThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask RunOnMain(Action action) { var task = new UnityTask(action, TaskStrategy.MainThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask RunOnCurrent(Action action) { var task = new UnityTask(action, TaskStrategy.CurrentThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task on the current thread that returns a result /// </summary> public static UnityTask <TResult> RunOnCurrent <TParam, TResult>(Func <TParam, TResult> function, TParam param) { var task = new UnityTask <TResult>(function, param, TaskStrategy.CurrentThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask Run(Action action) { var task = new UnityTask(action); task.Start(); return(task); }
/// <summary> /// Creates a new running task that returns a result /// </summary> public static UnityTask <TResult> RunCoroutine <TResult>(IEnumerator function) { var task = new UnityTask <TResult>(function); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask <TResult> Run <TParam, TResult>(Func <TParam, TResult> function, TParam param) { var task = new UnityTask <TResult>(function, param); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask <TResult> RunOnMain <TResult>(Func <TResult> function) { var task = new UnityTask <TResult>(function, TaskStrategy.MainThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask <TResult> Run <TResult>(Func <TResult> function) { var task = new UnityTask <TResult>(function); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask RunCoroutine(Func <IEnumerator> function) { var task = new UnityTask(function()); task.Start(); return(task); }
/// <summary> /// Creates a new running task /// </summary> public static UnityTask RunOnMain <TP>(Action <TP> action, TP param) { var task = new UnityTask(action, param, TaskStrategy.MainThread); task.Start(); return(task); }
/// <summary> /// Creates a new running task which passes the task as a parameter, and three additional parameters /// </summary> public static UnityTask RunCoroutine <TParam1, TParam2, TParam3>(Func <UnityTask, TParam1, TParam2, TParam3, IEnumerator> function, TParam1 param1, TParam2 param2, TParam3 param3) { var task = new UnityTask(); task.Strategy = TaskStrategy.Coroutine; task._routine = function(task, param1, param2, param3); task.Start(); return(task); }
/// <summary> /// Creates a new running task which passes the task as a parameter /// </summary> public static UnityTask RunCoroutine(Func <UnityTask, IEnumerator> function) { var task = new UnityTask(); task.Strategy = TaskStrategy.Coroutine; task._routine = function(task); task.Start(); return(task); }
/// <summary> /// Creates a task which returns a result, passes the task as a parameter, and passes two additional parameters /// </summary> public static UnityTask <TResult> RunCoroutine <TParam1, TParam2, TResult>(Func <UnityTask <TResult>, TParam1, TParam2, IEnumerator> function, TParam1 param1, TParam2 param2) { var task = new UnityTask <TResult>(); task.Strategy = TaskStrategy.Coroutine; task.Paramater = task; task._routine = function(task, param1, param2); task.Start(); return(task); }