Beispiel #1
0
            /// <summary>
            ///     Check if the current instruction is another list of instructions, if so add it to
            ///     <see cref="RecursiveInstructions" />
            /// </summary>
            private void CheckForInstructionRecursion()
            {
                var enumeratorInstruction = CurrentInstructions.Current as IEnumerator;

                if (enumeratorInstruction == null)
                {
                    var coroutineInstruction = CurrentInstructions.Current as Coroutine;
                    enumeratorInstruction = coroutineInstruction?.CurrentInstructions;
                    if (enumeratorInstruction == null)
                    {
                        return;
                    }
                }

                RecursiveInstructions.AddLast(enumeratorInstruction);
                CurrentInstructions = enumeratorInstruction;
            }