From 87dd5f13fd218428f46e284788018226bb1ee2d4 Mon Sep 17 00:00:00 2001 From: hikari Date: Wed, 9 Sep 2020 14:05:37 +0900 Subject: [PATCH 1/2] [Unwrap()] fix: remove type parameter --- .../Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs index 2acb110..27dea17 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs @@ -732,7 +732,7 @@ namespace Cysharp.Threading.Tasks return await await task; } - public static async UniTask Unwrap(this UniTask task) + public static async UniTask Unwrap(this UniTask task) { await await task; } @@ -742,7 +742,7 @@ namespace Cysharp.Threading.Tasks return await await task; } - public static async UniTask Unwrap(this Task task) + public static async UniTask Unwrap(this Task task) { await await task; } @@ -752,7 +752,7 @@ namespace Cysharp.Threading.Tasks return await await task; } - public static async UniTask Unwrap(this UniTask task) + public static async UniTask Unwrap(this UniTask task) { await await task; } From 65622b01f6bcbe79d0f0c4df62c3a76066d5fa5a Mon Sep 17 00:00:00 2001 From: hikari Date: Wed, 9 Sep 2020 14:15:03 +0900 Subject: [PATCH 2/2] [Unwrap] add ConfigureAwait --- .../UniTask/Runtime/UniTaskExtensions.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs index 27dea17..8664f03 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs @@ -741,22 +741,42 @@ namespace Cysharp.Threading.Tasks { return await await task; } + + public static async UniTask Unwrap(this Task> task, bool continueOnCapturedContext) + { + return await await task.ConfigureAwait(continueOnCapturedContext); + } public static async UniTask Unwrap(this Task task) { await await task; } + + public static async UniTask Unwrap(this Task task, bool continueOnCapturedContext) + { + await await task.ConfigureAwait(continueOnCapturedContext); + } public static async UniTask Unwrap(this UniTask> task) { return await await task; } + + public static async UniTask Unwrap(this UniTask> task, bool continueOnCapturedContext) + { + return await (await task).ConfigureAwait(continueOnCapturedContext); + } public static async UniTask Unwrap(this UniTask task) { await await task; } + public static async UniTask Unwrap(this UniTask task, bool continueOnCapturedContext) + { + await (await task).ConfigureAwait(continueOnCapturedContext); + } + #if UNITY_2018_3_OR_NEWER sealed class ToCoroutineEnumerator : IEnumerator