public void Write(BinaryWriter writer) { SaveSerializer.Write( writer, this, SaveSerialization.ExplicitTypes); }
//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)); }
public bool Load() { if (PlayerPrefs.HasKey("save")) { state = SaveSerializer.Deserialize <SaveState>(PlayerPrefs.GetString("save")); return(true); } else { state = new SaveState(); return(false); } }
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); } }
public void Read(BinaryReader reader) { SaveSerializer.Read( reader, this); }