Autosave changes to tilemap during runtime?

Discussion and help for Easy Save 3
Post Reply
Berncat
Posts: 14
Joined: Tue May 26, 2020 12:28 am

Autosave changes to tilemap during runtime?

Post by Berncat »

How would I go about saving changes to the tilemap at runtime using Autosave? I created a custom ES3Type for the level grid, tilemap renderer, and tilemap but changes still aren't being autosaved.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Autosave changes to tilemap during runtime?

Post by Joel »

Hi there,

Unity doesn't expose the fields required to serialise a Tilemap. Instead you would need to use Unity's TileMap.GetTilesBlock/SetTilesBlock to get the tile data, and use TileBase.GetTileData to get the data from the tile to be saved. You can then save this tile data and use it to reconstruct your TileMap.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply