Example #1
0
    public static void SaveCurrentValuesOfTheHero(CharacteristicsHero Characteristics)
    {
        BinaryFormatter        bf     = new BinaryFormatter();
        FileStream             stream = new FileStream(Application.dataPath + "/data/CurValue.sav", FileMode.Create);
        CurrentValuesOfTheHero data   = new CurrentValuesOfTheHero(Characteristics);

        bf.Serialize(stream, data);
        stream.Close();
    }
Example #2
0
 public static float[] LoadCurrentValuesOfTheHero()
 {
     if (File.Exists(Application.dataPath + "/data/CurValue.sav"))
     {
         BinaryFormatter        bf     = new BinaryFormatter();
         FileStream             stream = new FileStream(Application.dataPath + "/data/CurValue.sav", FileMode.Open);
         CurrentValuesOfTheHero data   = bf.Deserialize(stream) as CurrentValuesOfTheHero;
         stream.Close();
         return(data.CurrentValuesHero);
     }
     else
     {
         return(new float[0]);
     }
 }