Esempio n. 1
0
    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;
    }
Esempio n. 2
0
    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();
    }