public object Call(Interpreter interpreter, Token token, List <object> arguments) { MonstersTuple tuple = new MonstersTuple(); tuple.displayName = arguments[1]; tuple.spriteName = arguments[2]; tuple.onTick = arguments[3]; self.registeredMonsters[(string)arguments[0]] = tuple; return(null); }
public object Call(Interpreter interpreter, Token token, List <object> arguments) { //spawn the monster, which contains the tuple's information GameObject go = GameObject.Instantiate(self.gameController.monsterPrefab); MonsterController controller = go.GetComponent <MonsterController>(); MonstersTuple tuple = self.registeredMonsters[(string)arguments[0]]; controller.displayName = tuple.displayName; controller.spriteName = tuple.spriteName; controller.onTick = tuple.onTick; controller.positionX = (int)(double)arguments[1]; controller.positionY = (int)(double)arguments[2]; self.gameController.CacheEntity(go); return(null); }