From 6c64205292121bdfb6106b53fcc88c05bf67fb04 Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai Date: Fri, 17 Apr 2020 11:15:15 +0900 Subject: [PATCH 1/5] add readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 286528d..4a0b4d6 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,8 @@ 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=Assets/UniRx.Async"` to `Packages/manifest.json`. +If you want to set a target version, UniTask is using `*.*.*` release tag so you can specify a version like `#1.3.0`. For example `https://github.com/Cysharp/UniTask.git?path=Assets/UniRx.Async#1.3.0`. + License --- This library is under the MIT License. \ No newline at end of file From b4ec35aadda33008ead0ee92b1a038ca5319f14d Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai Date: Fri, 17 Apr 2020 11:31:27 +0900 Subject: [PATCH 2/5] Update config.yml --- .circleci/config.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95e5eaf..58ead3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,12 +82,6 @@ workflows: # - build-and-test: # unity_version: 2019.2.0b2 # unity_license: ${UNITY_LICENSE_2019_2} - - build-and-create-package: - unity_version: 2019.1.2f1 - unity_license: ${UNITY_LICENSE_2019_1} - filters: - tags: - only: /.*/ - build-and-test: unity_version: 2019.1.2f1 unity_license: ${UNITY_LICENSE_2019_1} @@ -102,7 +96,7 @@ workflows: # - build-and-test: # unity_version: 2018.3.12f1 # unity_license: ${UNITY_LICENSE_2018_3} - - build-and-create-package-release: + - build-and-create-package: unity_version: 2019.1.2f1 unity_license: ${UNITY_LICENSE_2019_1} filters: @@ -112,9 +106,9 @@ workflows: ignore: /.*/ - upload-github: requires: - - build-and-create-package-release + - build-and-create-package filters: tags: only: /^\d\.\d\.\d.*/ branches: - ignore: /.*/ \ No newline at end of file + ignore: /.*/ From 623936c7b8842c949ab15ba96303537d52672549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8F=E3=81=99=E3=81=AF?= Date: Fri, 24 Apr 2020 12:32:58 +0900 Subject: [PATCH 3/5] Fix timeoutTask continues to remain. --- Assets/UniRx.Async/UniTaskExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/UniRx.Async/UniTaskExtensions.cs b/Assets/UniRx.Async/UniTaskExtensions.cs index 06642df..2ec68dc 100644 --- a/Assets/UniRx.Async/UniTaskExtensions.cs +++ b/Assets/UniRx.Async/UniTaskExtensions.cs @@ -101,7 +101,7 @@ namespace UniRx.Async // left, right both suppress operation canceled exception. var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); + var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); @@ -147,7 +147,7 @@ namespace UniRx.Async // left, right both suppress operation canceled exception. var delayCancellationTokenSource = new CancellationTokenSource(); - var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow(); + var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); From 9f7b897837cc8e000d9dc249987b9231fb2643e9 Mon Sep 17 00:00:00 2001 From: neuecc Date: Sun, 26 Apr 2020 21:49:07 +0900 Subject: [PATCH 4/5] Add ObjectIdForDebugger to allow IDE stepin debug, #66, #41 --- Assets/Scenes/SandboxMain.cs | 46 ++++++++++++++++--- .../AsyncUniTaskMethodBuilder.cs | 32 +++++++++++++ .../AsyncUniTaskVoidMethodBuilder.cs | 16 +++++++ 3 files changed, 88 insertions(+), 6 deletions(-) diff --git a/Assets/Scenes/SandboxMain.cs b/Assets/Scenes/SandboxMain.cs index 1faf82d..0354ea9 100644 --- a/Assets/Scenes/SandboxMain.cs +++ b/Assets/Scenes/SandboxMain.cs @@ -14,13 +14,47 @@ public class SandboxMain : MonoBehaviour public Button cancelButton; CancellationTokenSource cts; - async void Start() + void Start() { - UnityEngine.Debug.Log("DOWNLOAD START:" + Time.frameCount); - - var req = await UnityWebRequest.Get(Path.Combine(Application.streamingAssetsPath, "test.txt")).SendWebRequest(); - - UnityEngine.Debug.Log("DOWNLOAD RESULT:" + Time.frameCount + ", " + req.downloadHandler.text); + okButton.onClick.AddListener(() => + { + FooAsync().Forget(); + }); + cancelButton.onClick.AddListener(() => + { + BarAsync().Forget(); + }); } + + async UniTask FooAsync() + { + // use F10, will crash. + var loop = int.Parse("9"); + await UniTask.DelayFrame(loop); + + Debug.Log("OK"); + await UniTask.DelayFrame(loop); + + Debug.Log("Again"); + + return 10; + } + + async UniTaskVoid BarAsync() + { + var loop = int.Parse("10"); + + + var foo = await UniTask.FromResult(100); + + Debug.Log("OK"); + + + Debug.Log("Again"); + + + } + + } diff --git a/Assets/UniRx.Async/CompilerServices/AsyncUniTaskMethodBuilder.cs b/Assets/UniRx.Async/CompilerServices/AsyncUniTaskMethodBuilder.cs index 586f859..76a358d 100644 --- a/Assets/UniRx.Async/CompilerServices/AsyncUniTaskMethodBuilder.cs +++ b/Assets/UniRx.Async/CompilerServices/AsyncUniTaskMethodBuilder.cs @@ -136,6 +136,22 @@ namespace UniRx.Async.CompilerServices public void SetStateMachine(IAsyncStateMachine stateMachine) { } + +#if UNITY_EDITOR + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif } @@ -268,6 +284,22 @@ namespace UniRx.Async.CompilerServices public void SetStateMachine(IAsyncStateMachine stateMachine) { } + +#if UNITY_EDITOR + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif } } diff --git a/Assets/UniRx.Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs b/Assets/UniRx.Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs index 2fcd55f..bedf7bf 100644 --- a/Assets/UniRx.Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs +++ b/Assets/UniRx.Async/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs @@ -84,6 +84,22 @@ namespace UniRx.Async.CompilerServices public void SetStateMachine(IAsyncStateMachine stateMachine) { } + +#if UNITY_EDITOR + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif } } From 28e1fa98c9db7a6fbe5d3bf2bcaf7a82d89e5b9a Mon Sep 17 00:00:00 2001 From: neuecc Date: Sun, 26 Apr 2020 21:49:58 +0900 Subject: [PATCH 5/5] 1.3.1 --- Assets/UniRx.Async/package.json | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/UniRx.Async/package.json b/Assets/UniRx.Async/package.json index ff5b17b..26b1eba 100644 --- a/Assets/UniRx.Async/package.json +++ b/Assets/UniRx.Async/package.json @@ -1,7 +1,7 @@ { "name": "com.cysharp.unitask", "displayName": "UniTask", - "version": "1.3.0", + "version": "1.3.1", "unity": "2018.3", "description": "Provides an efficient async/await integration to Unity.", "keywords": ["async/await", "async", "Task", "UniTask"], diff --git a/README.md b/README.md index 4a0b4d6..9ee782a 100644 --- a/README.md +++ b/README.md @@ -352,7 +352,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=Assets/UniRx.Async"` to `Packages/manifest.json`. -If you want to set a target version, UniTask is using `*.*.*` release tag so you can specify a version like `#1.3.0`. For example `https://github.com/Cysharp/UniTask.git?path=Assets/UniRx.Async#1.3.0`. +If you want to set a target version, UniTask is using `*.*.*` release tag so you can specify a version like `#1.3.0`. For example `https://github.com/Cysharp/UniTask.git?path=Assets/UniRx.Async#1.3.1`. License ---