Ejemplo n.º 1
0
    public void Load()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Open(Application.persistentDataPath + "/valeriaInfo.dat", FileMode.Open);
        ValeriaData     data = (ValeriaData)bf.Deserialize(file);

        file.Close();

        reputation = data.reputation;
        romance    = data.romance;
    }
Ejemplo n.º 2
0
    public void Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/valeriaInfo.dat");

        ValeriaData data = new ValeriaData();

        data.reputation = reputation;
        data.romance    = romance;

        bf.Serialize(file, data);
        file.Close();
    }