private YieldInstruction SafeMoveNext(CoroutinerExecutorBase coroutinerExecutorBase) { try { return(coroutinerExecutorBase.MoveNext()); } catch (Exception e) { if (e is CoroutineException) { throw e; } throw new CoroutineException(e); } }
private bool CheckCurrent(ref YieldInstruction refYieldInstruction) { if (coroutine.Current != null) { YieldInstruction yieldInstruction = coroutine.Current as YieldInstruction; if (yieldInstruction != null) { if (lastInstruction != yieldInstruction) { lastInstruction = yieldInstruction; refYieldInstruction = yieldInstruction; return(true); } } else { if (inner == null || !inner.IsCreatedFrom(coroutine.Current)) { IEnumerator iEnumerator = coroutine.Current as IEnumerator; IEnumerable iEnumerable = coroutine.Current as IEnumerable; if (iEnumerator != null) { inner = new IEnumeratorExecutor(iEnumerator); } if (iEnumerable != null) { inner = new IEnumerableExecutor(iEnumerable); } if (inner == null) { Debug.LogError(coroutine.Current.GetType()); } refYieldInstruction = SafeMoveNext(inner); return(true); } } } return(false); }
protected void StartTestCoroutine(IEnumerator coroutine, string className, string methodName, Action onDone) { SetTestCoroutineParams(className, methodName, onDone); enumeratorExecutor = new IEnumeratorExecutor(coroutine); }