public void OnImmovableCreated(Immovable obj) { GameObject obj_go = Instantiate(itemsMap[obj.objectType]); immovableGameObjectMap.Add(obj, obj_go); obj_go.name = obj.objectType + "_" + obj.tile.X + "_" + obj.tile.Y; obj_go.transform.position = new Vector3(obj.tile.X, 0, obj.tile.Y); obj_go.transform.SetParent(this.transform, true); // register a tile changing type callback obj.RegisterOnChangedCallback(OnImmovableChanged); }