Hi,
I have a TileMap already designed. Then I want to replicate it for 10 scenes and would like that any modification in it on any given scene would be automatically generated in any other scene. So I created a prefab of this TileMap. Then, when I open other scenes, I try to drag the prefab from the Project window to the Hierarchy, but to my surprise:
- Whenever I cross any of the views in Unity while dragging the prefab, I can see that in the hierarchy is appearing a TileMap Render Data. So if I move the mouse around the screen on and on while dragging, I get tons of Render Data objects.
- I also end up getting this exception while in the editor:
"
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[tk2dRuntime.TileMap.Layer,System.Boolean].get_Item (tk2dRuntime.TileMap.Layer key) (at /Applications/buildAgent/work/c514da0c8183631c/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
tk2dRuntime.TileMap.BuilderUtil.CreateRenderData (.tk2dTileMap tileMap, Boolean editMode, System.Collections.Generic.Dictionary`2 layersActive) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:317)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:276)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:486)
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:121)
"
Couldn't tell exactly when.
- If I delete all the Render Data instances and leave only the one that seems to be working, if I make a modification to the TileMap (adding some random tiles), it seems to ignore it in runtime (but I can see the new tiles in the editor!). And if I switch to another scene (commiting the TileMap and Applying the changes to the Prefab just before), the changes to the TileMap are ignored even in the editor.
Is all this erratic behaviour because I am doing something wrong trying to create a Prefab of aTileMap? Should I do it in another way?
I see that other option is to Additively load a scene that has this TileMap. Is it a much better solution?
Thank you very much in advance!