Hey guys, got a question.
So I’m working with this scriptable object TileData here, which has a bool HasSafehouse on it. During the game, this will become true if you’ve added on a safehouse to it (which I have working). The problem is, once I turn that boolean true, it stays true even when I exit out of play mode into the editor, and then start it up again. So, is there a way to reset the boolean, or any other values I assign to the scriptable object for that matter, to their original values on game start?
Sorry if the code is shit or anything, just got back into Unity and trying to find my footing.
[CreateAssetMenu]
public class TileData : ScriptableObject
{
public bool HasSafehouse = false;
public TileBase[] Tiles;
}
The code below is some of the other code where I get all the data and apply it to my tilemap. Didn’t know if I could do it here, but figured I should include it
[SerializeField]
private Tilemap Map;
[SerializeField]
private List<TileData> TileDatas;
private void Awake ()
{
DataFromTiles = new Dictionary<TileBase, TileData>();
foreach (var TileData in TileDatas)
{
foreach (var Tile in TileData.Tiles)
{
DataFromTiles.Add(Tile, TileData);
}
}
}