1
Support / Tilemap doesn't clear prefabs
« on: October 07, 2013, 04:11:41 am »
OK maybe I am doing this wrong, I created a sprite prefab, actually a TK2DtiledSprite. I used it in my tilemap by dragging and dropping it into the TileMapData. OK it displays correctly and works well, until I do something like ClearTile(x, y, 0); where the tile is the prefab, it doesn't get cleared.
The only way to remove the tiles are to destroy the gameobject... that is the tile. This is a real pain. I am using prefabs as doors. When a door is hit I can destroy the object, but lets say I redraw the tilemap. It leaves all the old prefabs, they don't get cleared.
Am I correct in the way I am doing this? I want the doors to have a singular trigger. So I created a sprite prefab with a trigger. I then dragged my sprite prefab into the tk2dTileMapData. Maybe there is a better way or a correct way to erase all the tiles in the map other than stepping though a 2D loop and clearing each tile? I do not draw my tilemaps I generate them procedural.
The only way to remove the tiles are to destroy the gameobject... that is the tile. This is a real pain. I am using prefabs as doors. When a door is hit I can destroy the object, but lets say I redraw the tilemap. It leaves all the old prefabs, they don't get cleared.
Am I correct in the way I am doing this? I want the doors to have a singular trigger. So I created a sprite prefab with a trigger. I then dragged my sprite prefab into the tk2dTileMapData. Maybe there is a better way or a correct way to erase all the tiles in the map other than stepping though a 2D loop and clearing each tile? I do not draw my tilemaps I generate them procedural.