Exemplo n.º 1
0
        public CommandSet Commands;         // this exists to provide a place to assign a CommandSet asset so that it will be loaded by Unity

        public void RunInstruction(Instruction instruction, InstructionContext context, object thisObject)
        {
            var store      = new InstructionStore(context, thisObject);
            var enumerator = instruction.Execute(store);

            StartCoroutine(new JoinEnumerator(enumerator));
        }
Exemplo n.º 2
0
        public IEnumerator Execute(InstructionContext context, object thisObject)
        {
            if (Instruction)
            {
                var store = new InstructionStore(context, thisObject);

                store.WriteInputs(_inputs);
                store.WriteOutputs(_outputs);
                yield return(Instruction.Execute(store));

                store.ReadOutputs(_outputs);
            }
        }
Exemplo n.º 3
0
        public void SetContext(InstructionContext context)
        {
            Global.Clear();

            if (context != null)
            {
                foreach (var store in context.Stores)
                {
                    Global.AddVariable(store.Key, VariableValue.Create(store.Value));
                }
            }

            Context = context;
        }
Exemplo n.º 4
0
        public void RunInstruction(InstructionCaller caller, InstructionContext context, object thisObject)
        {
            var enumerator = caller.Execute(context, thisObject);

            StartCoroutine(new JoinEnumerator(enumerator));
        }
Exemplo n.º 5
0
 public InstructionStore(InstructionContext context, object thisObject)
 {
     SetContext(context);
     ChangeThis(thisObject);
 }