public void Load() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/questListInfo.dat", FileMode.Open); QuestListData data = (QuestListData)bf.Deserialize(file); file.Close(); findBook = data.findBook; plantTrees = data.plantTrees; }
public void Save() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/questListInfo.dat"); QuestListData data = new QuestListData(); data.findBook = findBook; data.plantTrees = plantTrees; bf.Serialize(file, data); file.Close(); }