public void SaveAllData() { if (_gameStatistics != null) { //Save total game stats. _gameStatistics.SaveToPlayerPrefs(); } //Set the version FileFetch.SetFloat("VERSION", FileVersion); //Save item card data. SaveItemCardData(); //Save the options data. Options.Save(); //Save some more of players data. FileFetch.SetInt("GEMBANK", _gemBank); //Save total XP earned. FileFetch.SetInt("TOTALXP", _totalXP); //Sync after we save. //SyncAllData(); Debug.Log(Application.persistentDataPath + "/PlayerPrefs.txt"); }
public void SaveCardItem(bool overrideDirty = false) { //If we arent dirty or dont have an override. then dont go through with saving. if (!IsDirty) { return; } Debug.Log(this.name + "StartSave"); //Save all the Missions. foreach (BaseMission m in Missions) { m.SaveMissionStatus(); } //Save other data. if (_itemStatistics == null) { Debug.LogWarning("No Stats for Card_" + this.Label); } else { _itemStatistics.SaveToPlayerPrefs(); } //Save if we are unlcoked or not. int unlockedBool = 1; if (Unlocked) { unlockedBool = 2; } //Save our unlock state. FileFetch.SetInt(this.name + "_Unlocked", unlockedBool); //no longer dirty. IsDirty = false; Debug.Log(this.name + "EndSave"); }
//Write to player prefs function public void WriteToPlayerPrefs(string statsName) { FileFetch.SetInt(statsName + "_EntryDataValue_" + DataLabel, EntryValue); FileFetch.SetInt(statsName + "_EntryType_" + DataLabel, (int)EntryType); FileFetch.SetInt(statsName + "_EntryData_" + DataLabel, ValueData); }