public void Step(NCSContext context) { context.script = this; NCSInstruction instruction = instructions[context.GetPC()]; //Debug.Log(instruction.AsString()); instruction.Run(context); if (instruction.IncrementsPC) { //Debug.Log("Incrementing PC"); context.Step(); } lastInstruction = instruction; }
public NCSScript(Stream stream, string name) { // if (actions == null) // { // ReadActions(); // } // We read the NCS file directly from the stream file = new NCSFile(stream); scriptName = name; foreach (NCSOperation op in file.operations) { NCSInstruction instruction = (NCSInstruction)Activator.CreateInstance(op.opType); //Debug.Log(instruction); instruction.Initialize(op.args, this); instructions.Add(instruction); } }