I'm working on the structure of the fields that are persistent in my Unity game. Things like inventory, etc. It is saved by serializing a class and saving to disk (as explained here). The problem I'm having is figuring out the best practice to structure it all. I want 2 classes that can access it - one that checks and modifies the values during gameplay and another that actually saves and loads the data to disk. To have good object oriented design, I thought about trying to make the saved data a private, nested class but the saving is multithreaded and has 9 methods so it really seems like it should be a separate class - and if 2 classes access the saved data class then it has to be public, with all of its variables being public as well... which just seems like a bad design.  Also, I have a separate class from the get/set methods for the variables because it should be saving to disk a lot and the excessive amount of get and set methods will add up to make the file much larger...I'm really not sure what the best way of structuring this is, and I don't want to have to make a ton of changes later on if I choose the wrong structure. Any thoughts and opinions would be appreciated. Thanks.public class SaveData {    public float health;    public float energy;    public int currentLevel;    public int bullets;    .    .    .}Class that gets/sets data, seems almost pointless if it is public (besides tracking bugs, and possibly future checks to make sure values are legitpublic class DataController : MonoBehaviour {    [SerializeField]SaveController saveController;    SaveData data;    public void SetEnergy(float newEnergy)    {        data.energy = newEnergy;    }    public float GetEnergy()    {        return data.energy;    }    .    .    .}Class that saves the data to filepublic class SaveController : MonoBehaviour {    [SerializeField]DataController dataController;    Thread timeSaveThread;    Thread pickUpSaveThread;    // Use this for initialization    void Start () {       timeSaveThread = new Thread(BeginTimeSave);       timeSaveThread.Start();    }    public void StartPickupThread(){    }    void BeginTimeSave()//save every x minutes    {    }    void BeginPickUpSave()//save right after an item is picked up    {    }    void BinarySave()    {    }    .    .    .}
C#: Structuring Saved Data for a Game
c#;unity3d