public void SaveData() { ArcadeWrapper wrapper = new ArcadeWrapper(); wrapper.worldData = worldData; string contents = JsonUtility.ToJson(wrapper, true); System.IO.File.WriteAllText(path, contents); }
public void ReadData() { try { if (System.IO.File.Exists(path)) { string contents = System.IO.File.ReadAllText(path); ArcadeWrapper wrapper = JsonUtility.FromJson <ArcadeWrapper>(contents); worldData = wrapper.worldData; } else { Debug.Log("Unable to read the save data, file does notexist"); } } catch (System.Exception ex) { Debug.Log(ex.Message); } }