public void Load() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/joshInfo.dat", FileMode.Open); JoshData data = (JoshData)bf.Deserialize(file); file.Close(); reputation = data.reputation; romance = data.romance; }
public void Save() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/joshInfo.dat"); JoshData data = new JoshData(); data.reputation = reputation; data.romance = romance; bf.Serialize(file, data); file.Close(); }