mirror of https://github.com/Cysharp/UniTask
add Unwrap
parent
53907a3719
commit
32f9b9d4ac
|
@ -736,6 +736,26 @@ namespace Cysharp.Threading.Tasks
|
||||||
{
|
{
|
||||||
await await task;
|
await await task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async UniTask<T> Unwrap<T>(this Task<UniTask<T>> task)
|
||||||
|
{
|
||||||
|
return await await task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async UniTask Unwrap<T>(this Task<UniTask> task)
|
||||||
|
{
|
||||||
|
await await task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async UniTask<T> Unwrap<T>(this UniTask<Task<T>> task)
|
||||||
|
{
|
||||||
|
return await await task;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async UniTask Unwrap<T>(this UniTask<Task> task)
|
||||||
|
{
|
||||||
|
await await task;
|
||||||
|
}
|
||||||
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
#if UNITY_2018_3_OR_NEWER
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue