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)); }
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); } }
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; }
public void RunInstruction(InstructionCaller caller, InstructionContext context, object thisObject) { var enumerator = caller.Execute(context, thisObject); StartCoroutine(new JoinEnumerator(enumerator)); }
public InstructionStore(InstructionContext context, object thisObject) { SetContext(context); ChangeThis(thisObject); }