protected virtual bool ReadSaveHistory(string saveDataKey) { var historyData = string.Empty; #if UNITY_WEBPLAYER || UNITY_WEBGL historyData = PlayerPrefs.GetString(saveDataKey); #else var fullFilePath = GetFullFilePath(saveDataKey); if (System.IO.File.Exists(fullFilePath)) { historyData = System.IO.File.ReadAllText(fullFilePath); } #endif//UNITY_WEBPLAYER if (!string.IsNullOrEmpty(historyData)) { var tempSaveHistory = JsonUtility.FromJson <SaveHistory>(historyData); if (tempSaveHistory != null) { saveHistory = tempSaveHistory; return(true); } } return(false); }
protected virtual bool ReadSaveHistory(string saveDataKey) { var historyData = PlayerPrefs.GetString(saveDataKey); if (!string.IsNullOrEmpty(historyData)) { var tempSaveHistory = JsonUtility.FromJson<SaveHistory>(historyData); if (tempSaveHistory != null) { saveHistory = tempSaveHistory; return true; } } return false; }
protected virtual bool ReadSaveHistory(string saveDataKey) { var historyData = PlayerPrefs.GetString(saveDataKey); if (!string.IsNullOrEmpty(historyData)) { var tempSaveHistory = JsonUtility.FromJson <SaveHistory>(historyData); if (tempSaveHistory != null) { saveHistory = tempSaveHistory; return(true); } } return(false); }