Ejemplo n.º 1
0
 private static YieldInstruction ToYieldInstruction(object obj)
 {
     return(obj switch
     {
         YieldInstruction y => y,
         IEnumerator ie => Start(ie),
         Task t => t.ToYieldInstruction(),
         ValueTask t => t.ToYieldInstruction(),
         _ => new WaitUntilNextFrame(),
     });