implicit operator UniTask<T> -> UniTask
parent
6be955816b
commit
84f4d8007d
|
@ -406,6 +406,11 @@ namespace Cysharp.Threading.Tasks
|
||||||
return new UniTask(this.source, this.token);
|
return new UniTask(this.source, this.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator UniTask(UniTask<T> self)
|
||||||
|
{
|
||||||
|
return self.AsUniTask();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns (bool IsCanceled, T Result) instead of throws OperationCanceledException.
|
/// returns (bool IsCanceled, T Result) instead of throws OperationCanceledException.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -134,6 +134,9 @@ public class SandboxMain : MonoBehaviour
|
||||||
Application.logMessageReceived += Application_logMessageReceived;
|
Application.logMessageReceived += Application_logMessageReceived;
|
||||||
|
|
||||||
|
|
||||||
|
UniTask<int> foo = UniTask.FromResult(10);
|
||||||
|
Foo(foo);
|
||||||
|
|
||||||
//ucs = new UniTaskCompletionSource();
|
//ucs = new UniTaskCompletionSource();
|
||||||
|
|
||||||
//okButton.onClick.AddListener(async () =>
|
//okButton.onClick.AddListener(async () =>
|
||||||
|
@ -156,6 +159,10 @@ public class SandboxMain : MonoBehaviour
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Foo(UniTask t)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
async UniTaskVoid Go(AsyncUpdateTrigger trigger, int i, CancellationToken ct)
|
async UniTaskVoid Go(AsyncUpdateTrigger trigger, int i, CancellationToken ct)
|
||||||
{
|
{
|
||||||
await UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate);
|
await UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate);
|
||||||
|
|
Loading…
Reference in New Issue