public object Call(Interpreter interpreter, Token token, List <object> arguments) { ContainerTuple tuple = new ContainerTuple(); tuple.displayName = arguments[1]; tuple.spriteName = arguments[2]; tuple.type = arguments[3]; tuple.capacity = arguments[4]; self.registeredContainers[(string)arguments[0]] = tuple; return(null); }
public object Call(Interpreter interpreter, Token token, List <object> arguments) { //spawn the item, which contains the tuple's information GameObject go = GameObject.Instantiate(self.gameController.containerPrefab); ContainerController controller = go.GetComponent <ContainerController>(); ContainerTuple tuple = self.registeredContainers[(string)arguments[0]]; controller.displayName = tuple.displayName; controller.spriteName = tuple.spriteName; controller.type = tuple.type; controller.capacity = tuple.capacity; controller.positionX = (int)(double)arguments[1]; controller.positionY = (int)(double)arguments[2]; self.gameController.CacheEntity(go); return(new GameObjectWrapper(go)); }