From 4e460c11caaa732bb32e1cf4044bedc2f2cb648e Mon Sep 17 00:00:00 2001 From: neuecc Date: Wed, 16 Sep 2020 09:48:57 +0900 Subject: [PATCH] 2.0.34 --- README.md | 2 +- .../Addressables/AddressablesAsyncExtensions.cs | 3 ++- .../Assets/Plugins/UniTask/Runtime/UniTask.Run.cs | 14 +++++++------- src/UniTask/Assets/Plugins/UniTask/package.json | 2 +- src/UniTask/Assets/Scenes/ExceptionExamples.cs | 6 ++++++ src/UniTask/Assets/Scenes/SandboxMain.cs | 1 - 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3d56794..6feb45d 100644 --- a/README.md +++ b/README.md @@ -906,7 +906,7 @@ After Unity 2019.3.4f1, Unity 2020.1a21, that support path query parameter of gi or add `"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask"` to `Packages/manifest.json`. -If you want to set a target version, UniTask is using `*.*.*` release tag so you can specify a version like `#2.0.31`. For example `https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.0.31`. +If you want to set a target version, UniTask is using `*.*.*` release tag so you can specify a version like `#2.0.34`. For example `https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.0.34`. ### Install via OpenUPM diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs index b46e85d..f321bdb 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs @@ -31,7 +31,8 @@ namespace Cysharp.Threading.Tasks if (!handle.IsValid()) { - throw new Exception("Attempting to use an invalid operation handle"); + // autoReleaseHandle:true handle is invalid(immediately internal handle == null) so return completed. + return UniTask.CompletedTask; } if (handle.IsDone) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs index 253ac6d..8f7394a 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs @@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks // Run is a confusing name, use only RunOnThreadPool in the future. - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -39,7 +39,7 @@ namespace Cysharp.Threading.Tasks cancellationToken.ThrowIfCancellationRequested(); } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Action action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -67,7 +67,7 @@ namespace Cysharp.Threading.Tasks cancellationToken.ThrowIfCancellationRequested(); } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Func action, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -95,7 +95,7 @@ namespace Cysharp.Threading.Tasks cancellationToken.ThrowIfCancellationRequested(); } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Func action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -123,7 +123,7 @@ namespace Cysharp.Threading.Tasks cancellationToken.ThrowIfCancellationRequested(); } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Func func, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -150,7 +150,7 @@ namespace Cysharp.Threading.Tasks } } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Func> func, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -180,7 +180,7 @@ namespace Cysharp.Threading.Tasks } } - /// Run action on the threadPool and return to main thread if configureAwait = true. + /// [Obsolete]recommend to use RunOnThreadPool(or UniTask.Void(async void), UniTask.Create(async UniTask)). public static async UniTask Run(Func func, object state, bool configureAwait = true, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); diff --git a/src/UniTask/Assets/Plugins/UniTask/package.json b/src/UniTask/Assets/Plugins/UniTask/package.json index 94a6caa..02cb4f7 100644 --- a/src/UniTask/Assets/Plugins/UniTask/package.json +++ b/src/UniTask/Assets/Plugins/UniTask/package.json @@ -1,7 +1,7 @@ { "name": "com.cysharp.unitask", "displayName": "UniTask", - "version": "2.0.33", + "version": "2.0.34", "unity": "2018.4", "description": "Provides an efficient async/await integration to Unity.", "keywords": [ "async/await", "async", "Task", "UniTask" ], diff --git a/src/UniTask/Assets/Scenes/ExceptionExamples.cs b/src/UniTask/Assets/Scenes/ExceptionExamples.cs index a477dbe..b743d62 100644 --- a/src/UniTask/Assets/Scenes/ExceptionExamples.cs +++ b/src/UniTask/Assets/Scenes/ExceptionExamples.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using UnityEngine; +using UnityEngine.AddressableAssets; /*UNniTastWhenAnyTester*/ @@ -49,4 +50,9 @@ public class ExceptionExamples : MonoBehaviour await UniTask.Delay(100); return taskIndex; } + + //void AddressablesTest() + //{ + // Addressables.ClearDependencyCacheAsync("key", true); + //} } \ No newline at end of file diff --git a/src/UniTask/Assets/Scenes/SandboxMain.cs b/src/UniTask/Assets/Scenes/SandboxMain.cs index 59fb8a1..edbe43d 100644 --- a/src/UniTask/Assets/Scenes/SandboxMain.cs +++ b/src/UniTask/Assets/Scenes/SandboxMain.cs @@ -492,7 +492,6 @@ public class SandboxMain : MonoBehaviour Debug.Log("Current SyncContext:" + SynchronizationContext.Current.GetType().FullName); } - async UniTaskVoid Start() { //Expression.Lambda>(null).Compile(true);