Esempio n. 1
0
 public void Write(BinaryWriter writer)
 {
     SaveSerializer.Write(
         writer,
         this,
         SaveSerialization.ExplicitTypes);
 }
Esempio n. 2
0
    //save zapisany do player pref
    public void Save(EndlessBitDefense.GameManager gameManager, MapManager mapManager)
    {
        //DeleteSaveData();

        state.money      = gameManager.GetMoney();
        state.waveNumber = gameManager.waveNumber;
        state.SetMapTiles(mapManager.GetMapTiles());

        PlayerPrefs.SetString("save", SaveSerializer.Serialize <SaveState>(state));
    }
Esempio n. 3
0
 public bool Load()
 {
     if (PlayerPrefs.HasKey("save"))
     {
         state = SaveSerializer.Deserialize <SaveState>(PlayerPrefs.GetString("save"));
         return(true);
     }
     else
     {
         state = new SaveState();
         return(false);
     }
 }
Esempio n. 4
0
 public void SaveActivities()
 {
     try
     {
         if (JsonParser.SaveToJson(SaveSerializer.Serialize(this.Activities), "activities.json"))
         {
             MessageBox.Show("Activities saved successfuly");
         }
     }
     catch (Exception e)
     {
         MessageBox.Show("Saving problem occured: " + e.Message);
     }
 }
Esempio n. 5
0
 public void Read(BinaryReader reader)
 {
     SaveSerializer.Read(
         reader,
         this);
 }