UniTask Struct
Namespace: Cysharp.Threading.Tasks
Assembly: cs.temp.dll.dll
Lightweight unity specified task-like object.
public readonly struct UniTask
Members
Constructors
Name | Description |
---|---|
UniTask(IUniTaskSource, Int16) |
Fields
Name | Description |
---|---|
CompletedTask |
Properties
Name | Description |
---|---|
Status |
Methods
Constructors
UniTask(IUniTaskSource, Int16)
public UniTask(IUniTaskSource source, short token)
Parameters
source
IUniTaskSourcetoken
System.Int16
Fields
CompletedTask
public static readonly UniTask CompletedTask
Field Value
Properties
Status
public readonly UniTaskStatus Status { get; }
Property Value
Methods
Action(Func<CancellationToken, UniTaskVoid>, CancellationToken)
helper of create add UniTaskVoid to delegate.
public static Action Action(Func<CancellationToken, UniTaskVoid> asyncAction, CancellationToken cancellationToken)
Parameters
asyncAction
System.Func<CancellationToken, UniTaskVoid>cancellationToken
CancellationToken
Returns
- System.Action
Action(Func<UniTaskVoid>)
helper of create add UniTaskVoid to delegate. For example: FooAction = UniTask.Action(async () => { /* */ })
public static Action Action(Func<UniTaskVoid> asyncAction)
Parameters
asyncAction
System.Func<UniTaskVoid>
Returns
- System.Action
Action<T>(T, Func<T, UniTaskVoid>)
helper of create add UniTaskVoid to delegate.
public static Action Action<T>(T state, Func<T, UniTaskVoid> asyncAction)
Parameters
state
TasyncAction
System.Func<T, UniTaskVoid>
Returns
- System.Action
Type Parameters
T
AsAsyncUnitUniTask()
public readonly UniTask<AsyncUnit> AsAsyncUnitUniTask()
Returns
Create(Func<CancellationToken, UniTask>, CancellationToken)
public static UniTask Create(Func<CancellationToken, UniTask> factory, CancellationToken cancellationToken)
Parameters
factory
System.Func<CancellationToken, UniTask>cancellationToken
CancellationToken
Returns
Create(Func<UniTask>)
public static UniTask Create(Func<UniTask> factory)
Parameters
factory
System.Func<UniTask>
Returns
Create<T>(T, Func<T, UniTask>)
public static UniTask Create<T>(T state, Func<T, UniTask> factory)
Parameters
state
Tfactory
System.Func<T, UniTask>
Returns
Type Parameters
T
Create<T>(Func<UniTask<T>>)
public static UniTask<T> Create<T>(Func<UniTask<T>> factory)
Parameters
factory
System.Func<UniTask<T>>
Returns
- UniTask<T>
Type Parameters
T
Defer(Func<UniTask>)
Defer the task creation just before call await.
public static UniTask Defer(Func<UniTask> factory)
Parameters
factory
System.Func<UniTask>
Returns
Defer<TState>(TState, Func<TState, UniTask>)
Defer the task creation just before call await.
public static UniTask Defer<TState>(TState state, Func<TState, UniTask> factory)
Parameters
state
TStatefactory
System.Func<TState, UniTask>
Returns
Type Parameters
TState
Defer<T>(Func<UniTask<T>>)
Defer the task creation just before call await.
public static UniTask<T> Defer<T>(Func<UniTask<T>> factory)
Parameters
factory
System.Func<UniTask<T>>
Returns
- UniTask<T>
Type Parameters
T
Defer<TState, TResult>(TState, Func<TState, UniTask<TResult>>)
Defer the task creation just before call await.
public static UniTask<TResult> Defer<TState, TResult>(TState state, Func<TState, UniTask<TResult>> factory)
Parameters
state
TStatefactory
System.Func<TState, UniTask<TResult>>
Returns
- UniTask<TResult>
Type Parameters
TState
TResult
Delay(Int32, DelayType, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask Delay(int millisecondsDelay, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
millisecondsDelay
System.Int32delayType
DelayTypedelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Delay(Int32, Boolean, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask Delay(int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
millisecondsDelay
System.Int32ignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Delay(TimeSpan, DelayType, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask Delay(TimeSpan delayTimeSpan, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
delayTimeSpan
System.TimeSpandelayType
DelayTypedelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Delay(TimeSpan, Boolean, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask Delay(TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
delayTimeSpan
System.TimeSpanignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
DelayFrame(Int32, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
delayFrameCount
System.Int32delayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
FromCanceled(CancellationToken)
public static UniTask FromCanceled(CancellationToken cancellationToken = null)
Parameters
cancellationToken
CancellationToken
Returns
FromCanceled<T>(CancellationToken)
public static UniTask<T> FromCanceled<T>(CancellationToken cancellationToken = null)
Parameters
cancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
FromException(Exception)
public static UniTask FromException(Exception ex)
Parameters
ex
System.Exception
Returns
FromException<T>(Exception)
public static UniTask<T> FromException<T>(Exception ex)
Parameters
ex
System.Exception
Returns
- UniTask<T>
Type Parameters
T
FromResult<T>(T)
public static UniTask<T> FromResult<T>(T value)
Parameters
value
T
Returns
- UniTask<T>
Type Parameters
T
GetAwaiter()
public readonly UniTask.Awaiter GetAwaiter()
Returns
Lazy(Func<UniTask>)
public static AsyncLazy Lazy(Func<UniTask> factory)
Parameters
factory
System.Func<UniTask>
Returns
Lazy<T>(Func<UniTask<T>>)
public static AsyncLazy<T> Lazy<T>(Func<UniTask<T>> factory)
Parameters
factory
System.Func<UniTask<T>>
Returns
- AsyncLazy<T>
Type Parameters
T
Never(CancellationToken)
Never complete.
public static UniTask Never(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
Never<T>(CancellationToken)
Never complete.
public static UniTask<T> Never<T>(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
NextFrame()
Similar as UniTask.Yield but guaranteed run on next frame.
public static UniTask NextFrame()
Returns
NextFrame(CancellationToken, Boolean)
Similar as UniTask.Yield but guaranteed run on next frame.
public static UniTask NextFrame(CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
cancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
NextFrame(PlayerLoopTiming)
Similar as UniTask.Yield but guaranteed run on next frame.
public static UniTask NextFrame(PlayerLoopTiming timing)
Parameters
timing
PlayerLoopTiming
Returns
NextFrame(PlayerLoopTiming, CancellationToken, Boolean)
Similar as UniTask.Yield but guaranteed run on next frame.
public static UniTask NextFrame(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Preserve()
Memoizing inner IValueTaskSource. The result UniTask can await multiple.
public readonly UniTask Preserve()
Returns
ReturnToCurrentSynchronizationContext(Boolean, CancellationToken)
public static ReturnToSynchronizationContext ReturnToCurrentSynchronizationContext(bool dontPostWhenSameContext = true, CancellationToken cancellationToken = null)
Parameters
dontPostWhenSameContext
System.BooleancancellationToken
CancellationToken
Returns
ReturnToSynchronizationContext(SynchronizationContext, CancellationToken)
public static ReturnToSynchronizationContext ReturnToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = null)
Parameters
synchronizationContext
SynchronizationContextcancellationToken
CancellationToken
Returns
Run(Action, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.ActionconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
Run(Action<Object>, Object, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask Run(Action<object> action, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Action<System.Object>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
Run(Func<UniTask>, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask Run(Func<UniTask> action, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Func<UniTask>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
Run(Func<Object, UniTask>, Object, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask Run(Func<object, UniTask> action, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Func<System.Object, UniTask>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
Run<T>(Func<T>, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask<T> Run<T>(Func<T> func, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<T>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<UniTask<T>>, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask<T> Run<T>(Func<UniTask<T>> func, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<UniTask<T>>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<Object, T>, Object, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask<T> Run<T>(Func<object, T> func, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<System.Object, T>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<Object, UniTask<T>>, Object, Boolean, CancellationToken)
[Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")]
public static UniTask<T> Run<T>(Func<object, UniTask<T>> func, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<System.Object, UniTask<T>>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
RunOnThreadPool(Action, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask RunOnThreadPool(Action action, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.ActionconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
RunOnThreadPool(Action<Object>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask RunOnThreadPool(Action<object> action, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Action<System.Object>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
RunOnThreadPool(Func<UniTask>, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask RunOnThreadPool(Func<UniTask> action, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Func<UniTask>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
RunOnThreadPool(Func<Object, UniTask>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask RunOnThreadPool(Func<object, UniTask> action, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
action
System.Func<System.Object, UniTask>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
RunOnThreadPool<T>(Func<T>, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask<T> RunOnThreadPool<T>(Func<T> func, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<T>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
RunOnThreadPool<T>(Func<UniTask<T>>, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask<T> RunOnThreadPool<T>(Func<UniTask<T>> func, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<UniTask<T>>configureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
RunOnThreadPool<T>(Func<Object, T>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask<T> RunOnThreadPool<T>(Func<object, T> func, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<System.Object, T>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
RunOnThreadPool<T>(Func<Object, UniTask<T>>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static async UniTask<T> RunOnThreadPool<T>(Func<object, UniTask<T>> func, object state, bool configureAwait = true, CancellationToken cancellationToken = null)
Parameters
func
System.Func<System.Object, UniTask<T>>state
System.ObjectconfigureAwait
System.BooleancancellationToken
CancellationToken
Returns
- UniTask<T>
Type Parameters
T
SuppressCancellationThrow()
returns (bool IsCanceled) instead of throws OperationCanceledException.
public readonly UniTask<bool> SuppressCancellationThrow()
Returns
- UniTask<System.Boolean>
SwitchToSynchronizationContext(SynchronizationContext, CancellationToken)
public static SwitchToSynchronizationContextAwaitable SwitchToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = null)
Parameters
synchronizationContext
SynchronizationContextcancellationToken
CancellationToken
Returns
SwitchToTaskPool()
Note: use SwitchToThreadPool is recommended.
public static SwitchToTaskPoolAwaitable SwitchToTaskPool()
Returns
SwitchToThreadPool()
public static SwitchToThreadPoolAwaitable SwitchToThreadPool()
Returns
ToCoroutine(Func<UniTask>)
public static IEnumerator ToCoroutine(Func<UniTask> taskFactory)
Parameters
taskFactory
System.Func<UniTask>
Returns
- System.Collections.Generic.IEnumerator
ToString()
public override readonly string ToString()
Returns
- System.String
Overrides
Void(Func<CancellationToken, UniTaskVoid>, CancellationToken)
helper of fire and forget void action.
public static void Void(Func<CancellationToken, UniTaskVoid> asyncAction, CancellationToken cancellationToken)
Parameters
asyncAction
System.Func<CancellationToken, UniTaskVoid>cancellationToken
CancellationToken
Void(Func<UniTaskVoid>)
helper of fire and forget void action.
public static void Void(Func<UniTaskVoid> asyncAction)
Parameters
asyncAction
System.Func<UniTaskVoid>
Void<T>(Func<T, UniTaskVoid>, T)
helper of fire and forget void action.
public static void Void<T>(Func<T, UniTaskVoid> asyncAction, T state)
Parameters
asyncAction
System.Func<T, UniTaskVoid>state
T
Type Parameters
T
WaitForEndOfFrame()
[Obsolete("Use WaitForEndOfFrame(MonoBehaviour) instead or UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate). Equivalent for coroutine's WaitForEndOfFrame requires MonoBehaviour(runner of Coroutine).")]
public static YieldAwaitable WaitForEndOfFrame()
Returns
WaitForEndOfFrame(CancellationToken, Boolean)
[Obsolete("Use WaitForEndOfFrame(MonoBehaviour) instead or UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate). Equivalent for coroutine's WaitForEndOfFrame requires MonoBehaviour(runner of Coroutine).")]
public static UniTask WaitForEndOfFrame(CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
cancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitForEndOfFrame(MonoBehaviour)
public static UniTask WaitForEndOfFrame(MonoBehaviour coroutineRunner)
Parameters
coroutineRunner
MonoBehaviour
Returns
WaitForEndOfFrame(MonoBehaviour, CancellationToken, Boolean)
public static UniTask WaitForEndOfFrame(MonoBehaviour coroutineRunner, CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
coroutineRunner
MonoBehaviourcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitForFixedUpdate()
Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate).
public static YieldAwaitable WaitForFixedUpdate()
Returns
WaitForFixedUpdate(CancellationToken, Boolean)
Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken).
public static UniTask WaitForFixedUpdate(CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
cancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitForSeconds(Int32, Boolean, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitForSeconds(int duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
duration
System.Int32ignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitForSeconds(Single, Boolean, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitForSeconds(float duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
duration
System.SingleignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitUntil(Func<Boolean>, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitUntil(Func<bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
predicate
System.Func<System.Boolean>timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitUntil<T>(T, Func<T, Boolean>, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitUntil<T>(T state, Func<T, bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
state
Tpredicate
System.Func<T, System.Boolean>timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Type Parameters
T
WaitUntilCanceled(CancellationToken, PlayerLoopTiming, Boolean)
public static UniTask WaitUntilCanceled(CancellationToken cancellationToken, PlayerLoopTiming timing = PlayerLoopTiming.Update, bool completeImmediately = false)
Parameters
cancellationToken
CancellationTokentiming
PlayerLoopTimingcompleteImmediately
System.Boolean
Returns
WaitUntilValueChanged<T, U>(T, Func<T, U>, PlayerLoopTiming, IEqualityComparer<U>, CancellationToken, Boolean)
public static UniTask<U> WaitUntilValueChanged<T, U>(T target, Func<T, U> monitorFunction, PlayerLoopTiming monitorTiming = PlayerLoopTiming.Update, IEqualityComparer<U> equalityComparer = null, CancellationToken cancellationToken = null, bool cancelImmediately = false)
where T : class
Parameters
target
TmonitorFunction
System.Func<T, U>monitorTiming
PlayerLoopTimingequalityComparer
System.Collections.Generic.IEqualityComparer<U>cancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
- UniTask<U>
Type Parameters
T
U
WaitWhile(Func<Boolean>, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitWhile(Func<bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
predicate
System.Func<System.Boolean>timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
WaitWhile<T>(T, Func<T, Boolean>, PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask WaitWhile<T>(T state, Func<T, bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null, bool cancelImmediately = false)
Parameters
state
Tpredicate
System.Func<T, System.Boolean>timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Type Parameters
T
WhenAll(UniTask[])
public static UniTask WhenAll(params UniTask[] tasks)
Parameters
tasks
UniTask[]
Returns
WhenAll(IEnumerable<UniTask>)
public static UniTask WhenAll(IEnumerable<UniTask> tasks)
Parameters
tasks
System.Collections.Generic.IEnumerable<UniTask>
Returns
WhenAll<T>(UniTask<T>[])
public static UniTask<T[]> WhenAll<T>(params UniTask<T>[] tasks)
Parameters
tasks
UniTask<T>[]
Returns
- UniTask<T[]>
Type Parameters
T
WhenAll<T>(IEnumerable<UniTask<T>>)
public static UniTask<T[]> WhenAll<T>(IEnumerable<UniTask<T>> tasks)
Parameters
tasks
System.Collections.Generic.IEnumerable<UniTask<T>>
Returns
- UniTask<T[]>
Type Parameters
T
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10, T11>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10, T11, T12>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10, T11, T12, T13>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>, UniTask<T14>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13, UniTask<T14> task14)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10, T11, T12, T13, T14>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>, UniTask<T14>, UniTask<T15>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13, UniTask<T14> task14, UniTask<T15> task15)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9, T10, T11, T12, T13, T14, System.ValueTuple<T15>>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
WhenAll<T1, T2>(UniTask<T1>, UniTask<T2>)
public static UniTask<(T1, T2)> WhenAll<T1, T2>(UniTask<T1> task1, UniTask<T2> task2)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2>>
Type Parameters
T1
T2
WhenAll<T1, T2, T3>(UniTask<T1>, UniTask<T2>, UniTask<T3>)
public static UniTask<(T1, T2, T3)> WhenAll<T1, T2, T3>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3>>
Type Parameters
T1
T2
T3
WhenAll<T1, T2, T3, T4>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>)
public static UniTask<(T1, T2, T3, T4)> WhenAll<T1, T2, T3, T4>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4>>
Type Parameters
T1
T2
T3
T4
WhenAll<T1, T2, T3, T4, T5>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>)
public static UniTask<(T1, T2, T3, T4, T5)> WhenAll<T1, T2, T3, T4, T5>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5>>
Type Parameters
T1
T2
T3
T4
T5
WhenAll<T1, T2, T3, T4, T5, T6>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>)
public static UniTask<(T1, T2, T3, T4, T5, T6)> WhenAll<T1, T2, T3, T4, T5, T6>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6>>
Type Parameters
T1
T2
T3
T4
T5
T6
WhenAll<T1, T2, T3, T4, T5, T6, T7>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7)> WhenAll<T1, T2, T3, T4, T5, T6, T7>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>)
public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> WhenAll<T1, T2, T3, T4, T5, T6, T7, T8, T9>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9)
Parameters
Returns
- UniTask<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, System.ValueTuple<T8, T9>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
WhenAny(UniTask[])
Return value is winArgumentIndex
public static UniTask<int> WhenAny(params UniTask[] tasks)
Parameters
tasks
UniTask[]
Returns
- UniTask<System.Int32>
WhenAny(IEnumerable<UniTask>)
Return value is winArgumentIndex
public static UniTask<int> WhenAny(IEnumerable<UniTask> tasks)
Parameters
tasks
System.Collections.Generic.IEnumerable<UniTask>
Returns
- UniTask<System.Int32>
WhenAny<T>(UniTask<T>, UniTask)
public static UniTask<(bool hasResultLeft, T result)> WhenAny<T>(UniTask<T> leftTask, UniTask rightTask)
Parameters
Returns
- UniTask<System.ValueTuple<System.Boolean, T>>
Type Parameters
T
WhenAny<T>(UniTask<T>[])
public static UniTask<(int winArgumentIndex, T result)> WhenAny<T>(params UniTask<T>[] tasks)
Parameters
tasks
UniTask<T>[]
Returns
- UniTask<System.ValueTuple<System.Int32, T>>
Type Parameters
T
WhenAny<T>(IEnumerable<UniTask<T>>)
public static UniTask<(int winArgumentIndex, T result)> WhenAny<T>(IEnumerable<UniTask<T>> tasks)
Parameters
tasks
System.Collections.Generic.IEnumerable<UniTask<T>>
Returns
- UniTask<System.ValueTuple<System.Int32, T>>
Type Parameters
T
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10, T11>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10, T11, T12>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10, T11, T12, T13>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>, UniTask<T14>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13, UniTask<T14> task14)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10, T11, T12, T13, System.ValueTuple<T14>>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>, UniTask<T10>, UniTask<T11>, UniTask<T12>, UniTask<T13>, UniTask<T14>, UniTask<T15>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9, UniTask<T10> task10, UniTask<T11> task11, UniTask<T12> task12, UniTask<T13> task13, UniTask<T14> task14, UniTask<T15> task15)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9, T10, T11, T12, T13, System.ValueTuple<T14, T15>>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
WhenAny<T1, T2>(UniTask<T1>, UniTask<T2>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2)> WhenAny<T1, T2>(UniTask<T1> task1, UniTask<T2> task2)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2>>
Type Parameters
T1
T2
WhenAny<T1, T2, T3>(UniTask<T1>, UniTask<T2>, UniTask<T3>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3)> WhenAny<T1, T2, T3>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3>>
Type Parameters
T1
T2
T3
WhenAny<T1, T2, T3, T4>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4)> WhenAny<T1, T2, T3, T4>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4>>
Type Parameters
T1
T2
T3
T4
WhenAny<T1, T2, T3, T4, T5>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> WhenAny<T1, T2, T3, T4, T5>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5>>
Type Parameters
T1
T2
T3
T4
T5
WhenAny<T1, T2, T3, T4, T5, T6>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> WhenAny<T1, T2, T3, T4, T5, T6>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6>>
Type Parameters
T1
T2
T3
T4
T5
T6
WhenAny<T1, T2, T3, T4, T5, T6, T7>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> WhenAny<T1, T2, T3, T4, T5, T6, T7>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9>(UniTask<T1>, UniTask<T2>, UniTask<T3>, UniTask<T4>, UniTask<T5>, UniTask<T6>, UniTask<T7>, UniTask<T8>, UniTask<T9>)
public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)> WhenAny<T1, T2, T3, T4, T5, T6, T7, T8, T9>(UniTask<T1> task1, UniTask<T2> task2, UniTask<T3> task3, UniTask<T4> task4, UniTask<T5> task5, UniTask<T6> task6, UniTask<T7> task7, UniTask<T8> task8, UniTask<T9> task9)
Parameters
Returns
- UniTask<System.ValueTuple<System.Int32, T1, T2, T3, T4, T5, T6, System.ValueTuple<T7, T8, T9>>>
Type Parameters
T1
T2
T3
T4
T5
T6
T7
T8
T9
WhenEach<T>(UniTask<T>[])
public static IUniTaskAsyncEnumerable<WhenEachResult<T>> WhenEach<T>(params UniTask<T>[] tasks)
Parameters
tasks
UniTask<T>[]
Returns
Type Parameters
T
WhenEach<T>(IEnumerable<UniTask<T>>)
public static IUniTaskAsyncEnumerable<WhenEachResult<T>> WhenEach<T>(IEnumerable<UniTask<T>> tasks)
Parameters
tasks
System.Collections.Generic.IEnumerable<UniTask<T>>
Returns
Type Parameters
T
Yield()
public static YieldAwaitable Yield()
Returns
Yield(CancellationToken, Boolean)
public static UniTask Yield(CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
cancellationToken
CancellationTokencancelImmediately
System.Boolean
Returns
Yield(PlayerLoopTiming)
public static YieldAwaitable Yield(PlayerLoopTiming timing)
Parameters
timing
PlayerLoopTiming
Returns
Yield(PlayerLoopTiming, CancellationToken, Boolean)
public static UniTask Yield(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately = false)
Parameters
timing
PlayerLoopTimingcancellationToken
CancellationTokencancelImmediately
System.Boolean