ETTaskVoid.cs 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Diagnostics;
  3. using System.Runtime.CompilerServices;
  4. namespace ETModel
  5. {
  6. [AsyncMethodBuilder(typeof (ETAsyncTaskVoidMethodBuilder))]
  7. public struct ETTaskVoid
  8. {
  9. public void Forget()
  10. {
  11. }
  12. [DebuggerHidden]
  13. public Awaiter GetAwaiter()
  14. {
  15. return new Awaiter();
  16. }
  17. public struct Awaiter: ICriticalNotifyCompletion
  18. {
  19. [DebuggerHidden]
  20. public bool IsCompleted => true;
  21. [DebuggerHidden]
  22. public void GetResult()
  23. {
  24. throw new Exception("UniTask can't await, always fire-and-forget. use Forget instead of await.");
  25. }
  26. [DebuggerHidden]
  27. public void OnCompleted(Action continuation)
  28. {
  29. }
  30. [DebuggerHidden]
  31. public void UnsafeOnCompleted(Action continuation)
  32. {
  33. }
  34. }
  35. }
  36. }