Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MaddoScientisto

Pages: [1]
1
I have a bunch of sprite collections which I moved to another project, along with tilemapdata and tilemapeditordata assets, then I made a tilemap from scratch in a scene but now I'm getting weird behaviors such as the following error when editing tilemap:
Quote
NullReferenceException
tk2dRuntime.TileMap.BuilderUtil.HideTileMapPrefabs (.tk2dTileMap tileMap) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:280)
tk2dTileMap.BeginEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:547)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:1152)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)
UnityEditor.DockArea:OnGUI()

And this when committing:
Quote
NullReferenceException
tk2dRuntime.TileMap.BuilderUtil.HideTileMapPrefabs (.tk2dTileMap tileMap) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:280)
tk2dTileMap.ClearSpawnedInstances () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:225)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:304)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:526)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:1174)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)
UnityEditor.DockArea:OnGUI()

After this there are inconsistencies with the tilemap render data, sometimes background doesn't show up until I edit the tilemap or colliders aren't applied at all.

I even tried to remake the sprite collection from scratch and use the new one in a new tilemap, same thing happens.

Are there some files I shouldn't have copied? I also tried to rebuild index and rebuild all sprites but this still happens

2
Support / Serializing and Deserializing Tile Map
« on: April 10, 2015, 02:08:36 pm »
I've purchased this great toolkit about a week ago and I've been very pleased so far by the possibilities it offers.

I have made a few TileMaps and I've been writing code to piece the maps together into bigger maps, so far I've been saving each TileMap as a prefab and loading them up. This is getting too cumbersome though, I'd rather just serialize the map to a text/xml/whatever file and then both in the editor and ingame just load up that file, instance a new tilemap and build it back up according to the previously saved data.

I've been looking at the documentation and tried to make a few loops to try and catch all the data so right now I have the following for each tile:
- tile id
- tile coordinates
- tile flags (saved as string for now because I have no idea what they are supposed to contain yet)
- tile color (saved as string but I have no idea what it can be used for)
- tile layer number

Also I grabbed the editorDataGUID and the name of the "data" object.

Where is data stored?
Where is color stored (was it just that color variable from the tile?)?

Is this information enough to rebuild a fully working tilemap object?

Pages: [1]