Ejemplo n.º 1
0
        public override IEnumerator Run(InstructionGraph graph, InstructionStore variables, int iteration)
        {
            if (!Resolve(variables, Context, out var context))
            {
                context = variables.Context;
            }

            if (Source == InstructionSource.Value)
            {
                if (WaitForCompletion)
                {
                    yield return(Instruction.Execute(variables, context));
                }
                else
                {
                    CompositionManager.Instance.RunInstruction(Instruction, variables, context);
                }
            }
            else if (Source == InstructionSource.Reference)
            {
                if (ResolveObject(variables, Reference, out Instruction instruction))
                {
                    if (WaitForCompletion)
                    {
                        yield return(instruction.Execute(context));
                    }
                    else
                    {
                        CompositionManager.Instance.RunInstruction(instruction, context);
                    }
                }
            }

            graph.GoTo(Next, nameof(Next));
        }
Ejemplo n.º 2
0
        protected override IEnumerator Run_(InstructionGraph graph, InstructionStore variables, int iteration)
        {
            if (WaitForCompletion)
            {
                yield return(Instruction.Execute(variables.Context, variables.This));
            }
            else
            {
                InstructionManager.Instance.RunInstruction(Instruction, variables.Context, variables.This);
            }

            graph.GoTo(Next, variables.This, nameof(Next));
        }
Ejemplo n.º 3
0
        public void RunInstruction(InstructionCaller caller, InstructionContext context, object thisObject)
        {
            var enumerator = caller.Execute(context, thisObject);

            StartCoroutine(new JoinEnumerator(enumerator));
        }
Ejemplo n.º 4
0
        public void RunInstruction(InstructionCaller caller, IVariableStore store, VariableValue context)
        {
            var enumerator = caller.Execute(store, context);

            StartCoroutine(new JoinEnumerator(enumerator, caller.Instruction));
        }