using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IPA.Utilities.Async { /// /// A class providing coroutine helpers. /// public static class Coroutines { /// /// Stalls the coroutine until completes, faults, or is canceled. /// /// the to wait for /// a coroutine waiting for the given task public static IEnumerator WaitForTask(Task task) { while (!task.IsCompleted && !task.IsCanceled && !task.IsFaulted) yield return null; } } }