示例#1
0
    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;
    }
示例#2
0
    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();
    }