First a short overview. I’m making a grid based game, in which every tile has a TileType. The TileType is a class with properties such as unwalkable, blocks sight etc. The TileType instances are arranged in a Dictionary that uses grid coordinates as key. This lets me look up the TileType for any tile on the grid, and it works great for the most part.
However, I get some problems with data persistence between edit mode and play mode. The thing is, the grid is edited in edit mode. And sometimes when I try it out in play mode, it seems the dictionary resets when I exit play mode. What would be a good way to store the dictionary in such a way that it persists between play mode and edit mode? I’m thinking maybe scriptable objects, but I haven’t quite been able to wrap my head around what they are for and how they work, so I’m not sure about that.
Any suggestions?