UniTask Struct
Namespace: Cysharp.Threading.Tasks
Assembly: cs.temp.dll.dll
Lightweight unity specified task-like object.
public struct UniTask
Members
Constructors
Name | Description |
---|---|
UniTask(IUniTaskSource, Int16) |
Fields
Name | Description |
---|---|
CompletedTask |
Properties
Name | Description |
---|---|
Status |
Methods
Operators
Name | Description |
---|---|
Implicit(UniTask to ValueTask) |
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 UniTaskStatus Status { get; }
Property Value
Methods
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(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<System.Threading.CancellationToken, UniTaskVoid>cancellationToken
System.Threading.CancellationToken
Returns
- System.Action
AsAsyncUnitUniTask()
public UniTask<AsyncUnit> AsAsyncUnitUniTask()
Returns
Create(Func<UniTask>)
public static UniTask Create(Func<UniTask> factory)
Parameters
factory
System.Func<UniTask>
Returns
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<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
Delay(Int32, DelayType, PlayerLoopTiming, CancellationToken)
public static UniTask Delay(int millisecondsDelay, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
millisecondsDelay
System.Int32delayType
DelayTypedelayTiming
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
Delay(Int32, Boolean, PlayerLoopTiming, CancellationToken)
public static UniTask Delay(int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
millisecondsDelay
System.Int32ignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
Delay(TimeSpan, DelayType, PlayerLoopTiming, CancellationToken)
public static UniTask Delay(TimeSpan delayTimeSpan, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
delayTimeSpan
System.TimeSpandelayType
DelayTypedelayTiming
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
Delay(TimeSpan, Boolean, PlayerLoopTiming, CancellationToken)
public static UniTask Delay(TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
delayTimeSpan
System.TimeSpanignoreTimeScale
System.BooleandelayTiming
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
DelayFrame(Int32, PlayerLoopTiming, CancellationToken)
public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
delayFrameCount
System.Int32delayTiming
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
FromCanceled(CancellationToken)
public static UniTask FromCanceled(CancellationToken cancellationToken = default(CancellationToken))
Parameters
cancellationToken
System.Threading.CancellationToken
Returns
FromCanceled<T>(CancellationToken)
public static UniTask<T> FromCanceled<T>(CancellationToken cancellationToken = default(CancellationToken))
Parameters
cancellationToken
System.Threading.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 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
System.Threading.CancellationToken
Returns
Never<T>(CancellationToken)
Never complete.
public static UniTask<T> Never<T>(CancellationToken cancellationToken)
Parameters
cancellationToken
System.Threading.CancellationToken
Returns
- UniTask<T>
Type Parameters
T
NextFrame(PlayerLoopTiming, CancellationToken)
Similar as UniTask.Yield but guaranteed run on next frame.
public static UniTask NextFrame(PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
timing
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
Preserve()
Memoizing inner IValueTaskSource. The result UniTask can await multiple.
public UniTask Preserve()
Returns
ReturnToCurrentSynchronizationContext(Boolean, CancellationToken)
public static ReturnToSynchronizationContext ReturnToCurrentSynchronizationContext(bool dontPostWhenSameContext = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
dontPostWhenSameContext
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
ReturnToSynchronizationContext(SynchronizationContext, CancellationToken)
public static ReturnToSynchronizationContext ReturnToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
synchronizationContext
System.Threading.SynchronizationContextcancellationToken
System.Threading.CancellationToken
Returns
Run(Action, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.ActionconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
Run(Action<Object>, Object, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask Run(Action<object> action, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Action<System.Object>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
Run(Func<UniTask>, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask Run(Func<UniTask> action, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Func<UniTask>configureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
Run(Func<Object, UniTask>, Object, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask Run(Func<object, UniTask> action, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Func<System.Object, UniTask>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
Run<T>(Func<T>, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask<T> Run<T>(Func<T> func, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<T>configureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<UniTask<T>>, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask<T> Run<T>(Func<UniTask<T>> func, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<UniTask<T>>configureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<Object, T>, Object, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask<T> Run<T>(Func<object, T> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<System.Object, T>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
- UniTask<T>
Type Parameters
T
Run<T>(Func<Object, UniTask<T>>, Object, Boolean, CancellationToken)
[Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)).
public static UniTask<T> Run<T>(Func<object, UniTask<T>> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<System.Object, UniTask<T>>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.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 UniTask RunOnThreadPool(Action action, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.ActionconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
RunOnThreadPool(Action<Object>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static UniTask RunOnThreadPool(Action<object> action, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Action<System.Object>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
RunOnThreadPool(Func<UniTask>, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static UniTask RunOnThreadPool(Func<UniTask> action, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Func<UniTask>configureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
RunOnThreadPool(Func<Object, UniTask>, Object, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static UniTask RunOnThreadPool(Func<object, UniTask> action, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
action
System.Func<System.Object, UniTask>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
RunOnThreadPool<T>(Func<T>, Boolean, CancellationToken)
Run action on the threadPool and return to main thread if configureAwait = true.
public static UniTask<T> RunOnThreadPool<T>(Func<T> func, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<T>configureAwait
System.BooleancancellationToken
System.Threading.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 UniTask<T> RunOnThreadPool<T>(Func<UniTask<T>> func, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<UniTask<T>>configureAwait
System.BooleancancellationToken
System.Threading.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 UniTask<T> RunOnThreadPool<T>(Func<object, T> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<System.Object, T>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.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 UniTask<T> RunOnThreadPool<T>(Func<object, UniTask<T>> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
func
System.Func<System.Object, UniTask<T>>state
System.ObjectconfigureAwait
System.BooleancancellationToken
System.Threading.CancellationToken
Returns
- UniTask<T>
Type Parameters
T
SuppressCancellationThrow()
returns (bool IsCanceled) instead of throws OperationCanceledException.
public UniTask<bool> SuppressCancellationThrow()
Returns
- UniTask<System.Boolean>
SwitchToSynchronizationContext(SynchronizationContext, CancellationToken)
public static SwitchToSynchronizationContextAwaitable SwitchToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
synchronizationContext
System.Threading.SynchronizationContextcancellationToken
System.Threading.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
- IEnumerator
ToString()
public override string ToString()
Returns
- System.String
Overrides
Void(Func<UniTaskVoid>)
helper of fire and forget void action.
public static void Void(Func<UniTaskVoid> asyncAction)
Parameters
asyncAction
System.Func<UniTaskVoid>
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<System.Threading.CancellationToken, UniTaskVoid>cancellationToken
System.Threading.CancellationToken
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()
Same as UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate).
public static YieldAwaitable WaitForEndOfFrame()
Returns
WaitForEndOfFrame(CancellationToken)
Same as UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate, cancellationToken).
public static UniTask WaitForEndOfFrame(CancellationToken cancellationToken)
Parameters
cancellationToken
System.Threading.CancellationToken
Returns
WaitForFixedUpdate()
Same as UniTask.Yield(PlayerLoopTiming.FixedUpdate).
public static YieldAwaitable WaitForFixedUpdate()
Returns
WaitForFixedUpdate(CancellationToken)
Same as UniTask.Yield(PlayerLoopTiming.FixedUpdate, cancellationToken).
public static UniTask WaitForFixedUpdate(CancellationToken cancellationToken)
Parameters
cancellationToken
System.Threading.CancellationToken
Returns
WaitUntil(Func<Boolean>, PlayerLoopTiming, CancellationToken)
public static UniTask WaitUntil(Func<bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
predicate
System.Func<System.Boolean>timing
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
WaitUntilCanceled(CancellationToken, PlayerLoopTiming)
public static UniTask WaitUntilCanceled(CancellationToken cancellationToken, PlayerLoopTiming timing = PlayerLoopTiming.Update)
Parameters
cancellationToken
System.Threading.CancellationTokentiming
PlayerLoopTiming
Returns
WaitUntilValueChanged<T, U>(T, Func<T, U>, PlayerLoopTiming, IEqualityComparer<U>, CancellationToken)
public static UniTask<U> WaitUntilValueChanged<T, U>(T target, Func<T, U> monitorFunction, PlayerLoopTiming monitorTiming = PlayerLoopTiming.Update, IEqualityComparer<U> equalityComparer = null, CancellationToken cancellationToken = default(CancellationToken))
where T : class
Parameters
target
TmonitorFunction
System.Func<T, U>monitorTiming
PlayerLoopTimingequalityComparer
IEqualityComparer<U>cancellationToken
System.Threading.CancellationToken
Returns
- UniTask<U>
Type Parameters
T
U
WaitWhile(Func<Boolean>, PlayerLoopTiming, CancellationToken)
public static UniTask WaitWhile(Func<bool> predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
Parameters
predicate
System.Func<System.Boolean>timing
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
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
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
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
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
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
Yield(PlayerLoopTiming)
public static YieldAwaitable Yield(PlayerLoopTiming timing = PlayerLoopTiming.Update)
Parameters
timing
PlayerLoopTiming
Returns
Yield(PlayerLoopTiming, CancellationToken)
public static UniTask Yield(PlayerLoopTiming timing, CancellationToken cancellationToken)
Parameters
timing
PlayerLoopTimingcancellationToken
System.Threading.CancellationToken
Returns
Operators
Implicit(UniTask to ValueTask)
public static implicit operator ValueTask(in UniTask self)
Parameters
self
UniTask
Returns
- System.Threading.Tasks.ValueTask