Compare commits

..

7 Commits
1.3.0 ... 1.3.1

Author SHA1 Message Date
neuecc
28e1fa98c9 1.3.1 2020-04-26 21:50:29 +09:00
neuecc
9f7b897837 Add ObjectIdForDebugger to allow IDE stepin debug, #66, #41 2020-04-26 21:49:07 +09:00
Yoshifumi Kawai
341953b441 Merge pull request #65 from vc-kusuha/fix_Timeout
Fix timeoutTask continues to remain.
2020-04-24 14:57:05 +09:00
くすは
623936c7b8 Fix timeoutTask continues to remain. 2020-04-24 12:32:58 +09:00
Yoshifumi Kawai
b4ec35aadd Update config.yml 2020-04-17 11:31:27 +09:00
Yoshifumi Kawai
6c64205292 add readme 2020-04-17 11:15:48 +09:00
Yoshifumi Kawai
e6734478c5 r 2020-04-16 21:08:56 +09:00
7 changed files with 97 additions and 19 deletions

View File

@@ -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: /.*/
ignore: /.*/

View File

@@ -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<int> 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");
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -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);

View File

@@ -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"],

View File

@@ -241,7 +241,7 @@ public class Foo : MonoBehaviour, IProgress<float>
UniTaskTracker
---
useful for check(leak) UniTasks. You can open tracker window in `Window -> UniRx -> UniTask Tracker`.
useful for check(leak) UniTasks. You can open tracker window in `Window -> UniTask Tracker`.
![](https://user-images.githubusercontent.com/46207/50421527-abf1cf80-0883-11e9-928a-ffcd47b8c454.png)
@@ -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.1`.
License
---
This library is under the MIT License.