I'm looking for some pointers or guidance on how to save Tilemaps.
I'm aware currently Tilemap objects are not supported by ES3 (is there a technical reason for this? Or is it just not yet implemented?), so I'm trying to implement it myself. The main problems is that the tiles themselves do not load after being saved. Been struggling a while though...
Simply adding ES3UserType scripts was my first try, but does not work.
The main problem is that I don't find the actual tile data itself (e.g. pos x, y = tile 6, ... ) to serialize. Once I have that, I think it would be straightforward. I've been trying to find the data by:
- attaching a debugger and inspecting the Tilemap objects
- reading through the Unity YAML files for prefabs containing Tilemap objects
Code: Select all
--- !u!1839735485 &1702681037762649997
Tilemap:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8758648864012842903}
m_Enabled: 1
m_Tiles:
- first: {x: 0, y: -3, z: 0}
second:
serializedVersion: 2
m_TileIndex: 3
m_TileSpriteIndex: 3
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
m_AllTileFlags: 1073741825
- first: {x: 1, y: -3, z: 0}
second:
serializedVersion: 2
m_TileIndex: 2
m_TileSpriteIndex: 2
m_TileMatrixIndex: 0
m_TileColorIndex: 0
m_TileObjectToInstantiateIndex: 65535
m_AllTileFlags: 1073741825
...
I would appreciate any hints of people who already succeeded in this, or even alternative approaches.
Cheers!
Jedyte