コード例 #1
0
 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);
 }