mirror of https://github.com/Cysharp/UniTask
UniTaskVoid can not await.
parent
8b7f832c0f
commit
b8c109848e
|
@ -4,7 +4,7 @@ using System;
|
||||||
|
|
||||||
namespace Cysharp.Threading.Tasks
|
namespace Cysharp.Threading.Tasks
|
||||||
{
|
{
|
||||||
public struct AsyncUnit : IEquatable<AsyncUnit>
|
public readonly struct AsyncUnit : IEquatable<AsyncUnit>
|
||||||
{
|
{
|
||||||
public static readonly AsyncUnit Default = new AsyncUnit();
|
public static readonly AsyncUnit Default = new AsyncUnit();
|
||||||
|
|
||||||
|
|
|
@ -9,41 +9,41 @@ using Cysharp.Threading.Tasks.CompilerServices;
|
||||||
namespace Cysharp.Threading.Tasks
|
namespace Cysharp.Threading.Tasks
|
||||||
{
|
{
|
||||||
[AsyncMethodBuilder(typeof(AsyncUniTaskVoidMethodBuilder))]
|
[AsyncMethodBuilder(typeof(AsyncUniTaskVoidMethodBuilder))]
|
||||||
public struct UniTaskVoid
|
public readonly struct UniTaskVoid
|
||||||
{
|
{
|
||||||
public void Forget()
|
public void Forget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[DebuggerHidden]
|
// [DebuggerHidden]
|
||||||
public Awaiter GetAwaiter()
|
// public Awaiter GetAwaiter()
|
||||||
{
|
// {
|
||||||
return new Awaiter();
|
// return new Awaiter();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public struct Awaiter : ICriticalNotifyCompletion
|
// public struct Awaiter : ICriticalNotifyCompletion
|
||||||
{
|
// {
|
||||||
[DebuggerHidden]
|
// [DebuggerHidden]
|
||||||
public bool IsCompleted => true;
|
// public bool IsCompleted => true;
|
||||||
|
|
||||||
[DebuggerHidden]
|
// [DebuggerHidden]
|
||||||
public void GetResult()
|
// public void GetResult()
|
||||||
{
|
// {
|
||||||
#if UNITY_2018_3_OR_NEWER
|
//#if UNITY_2018_3_OR_NEWER
|
||||||
UnityEngine.Debug.LogWarning("UniTaskVoid can't await, always fire-and-forget. use Forget instead of await.");
|
// UnityEngine.Debug.LogWarning("UniTaskVoid can't await, always fire-and-forget. use Forget instead of await.");
|
||||||
#endif
|
//#endif
|
||||||
}
|
// }
|
||||||
|
|
||||||
[DebuggerHidden]
|
// [DebuggerHidden]
|
||||||
public void OnCompleted(Action continuation)
|
// public void OnCompleted(Action continuation)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
|
|
||||||
[DebuggerHidden]
|
// [DebuggerHidden]
|
||||||
public void UnsafeOnCompleted(Action continuation)
|
// public void UnsafeOnCompleted(Action continuation)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue