public static Routiner runRoutine(this MonoBehaviour go, IEnumerator routine) { var wroutine = new Routiner(routine); wroutine.unityRoutine = go.StartCoroutine(wroutine); return(wroutine); }
private bool runSubRoutine() { bool moved = subRoutine.MoveNext(); if (!moved) { Current = subRoutine.Current; subRoutine = null; } return(moved); }
private bool runMainRoutine() { bool moved = mainRoutine.MoveNext(); Current = mainRoutine.Current; if (moved && mainRoutine.Current is IEnumerator) { var newSubroutine = (IEnumerator)mainRoutine.Current; if (subRoutine != null) { Debug.LogWarning("over writing existing subroutine"); } subRoutine = new Routiner(newSubroutine); } finished = moved; return(moved); }