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(), });