public static Coroutine StartCoroutine(IEnumerator iterationResult, bool canStopWhenClearScene = true) { //Create GameObject with MonoBehaviour to handle task. if (coroutineContainer == null) { coroutineContainer = new GameObject("Coroutiner"); cache = coroutineContainer.AddComponent(typeof(CoroutinerInstance)) as CoroutinerInstance; } Action del = delegate { }; return(cache.ProcessWork(iterationResult, canStopWhenClearScene, del)); }
public static void ResumeAllCoroutine() { if (cache != null) { CoroutinerInstance coroutinerInstance = cache; List <CoroutineController> c = coroutinerInstance.coroutineController; for (int i = 0; i < c.Count; i++) { if (c[i].state == CoroutineState.Paused) { c[i].Resume(); } } } }