private static void SavePersistentCache() { lastTimeSavedPersistentCache = DCLTime.realtimeSinceStartup; //NOTE(Brian): Use JsonConvert because unity JsonUtility doesn't support dictionaries string cacheJson = JsonConvert.SerializeObject(dependenciesMap); PlayerPrefsUtils.SetString(PERSISTENT_CACHE_KEY, cacheJson); }
private void SaveLatestReadChatMessagesStatus() { List <KeyValuePair <string, long> > lastReadChatMessagesList = new List <KeyValuePair <string, long> >(); using (var iterator = CommonScriptableObjects.lastReadChatMessages.GetEnumerator()) { while (iterator.MoveNext()) { lastReadChatMessagesList.Add(new KeyValuePair <string, long>(iterator.Current.Key, iterator.Current.Value)); } } PlayerPrefsUtils.SetString(PLAYER_PREFS_LAST_READ_CHAT_MESSAGES, JsonConvert.SerializeObject(lastReadChatMessagesList)); PlayerPrefsUtils.Save(); }
private void SaveLatestReadWorldChatMessagesStatus() { PlayerPrefsUtils.SetString(PLAYER_PREFS_LAST_READ_WORLD_CHAT_MESSAGES, CommonScriptableObjects.lastReadWorldChatMessages.Get().ToString()); PlayerPrefsUtils.Save(); }
public void SaveSettings() { PlayerPrefsUtils.SetString(GENERAL_SETTINGS_KEY, JsonUtility.ToJson(currentGeneralSettings)); PlayerPrefsUtils.SetString(QUALITY_SETTINGS_KEY, JsonUtility.ToJson(currentQualitySettings)); PlayerPrefsUtils.Save(); }
private void SaveLatestOpenChats() { PlayerPrefsUtils.SetString(PLAYER_PREFS_LATEST_OPEN_CHATS, JsonConvert.SerializeObject(CommonScriptableObjects.latestOpenChats.GetList())); PlayerPrefsUtils.Save(); }