Exemple #1
0
    public void SaveMissions(IOMissionModel missions)
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Open(Application.persistentDataPath + missionsFileName, FileMode.Open);

        bf.Serialize(file, missions);
        file.Close();
    }
Exemple #2
0
 public IOMissionModel LoadMission()
 {
     if (File.Exists(Application.persistentDataPath + missionsFileName))
     {
         BinaryFormatter bf    = new BinaryFormatter();
         FileStream      file  = File.Open(Application.persistentDataPath + missionsFileName, FileMode.Open);
         IOMissionModel  score = (IOMissionModel)bf.Deserialize(file);
         file.Close();
         return(score);
     }
     return(new IOMissionModel());
 }