public void LoadMapVersions() { using (Stream stream = File.Open(Application.persistentDataPath + "/MapVersionData.dat", FileMode.Open)) { BinaryFormatter fm = new BinaryFormatter(); MapVersionData temp = (MapVersionData)fm.Deserialize(stream); mapVersionListing = temp.mapDictionaryPairs; } }
public void SaveMapVersions() { using (Stream stream = File.Open(Application.persistentDataPath + "/MapVersionData.dat", FileMode.Create)) { BinaryFormatter fm = new BinaryFormatter(); MapVersionData temp = new MapVersionData(mapVersionListing); fm.Serialize(stream, temp); stream.Close(); } }