public static List <T> GetCustomList <T>(string key, string field, List <T> defaultVal) where T : IGDEData { List <T> retVal = defaultVal; try { if (PlayerPrefs.HasKey(key + "_" + field)) { retVal = new List <T>(); List <string> customDataKeys = GDEDataManager.GetStringList(key, field, null); if (customDataKeys != null) { foreach (string customDataKey in customDataKeys) { retVal.Add((T)Activator.CreateInstance(typeof(T), new object[] { customDataKey })); } } } } catch (Exception ex) { Debug.LogException(ex); } return(retVal); }
public static List <T> GetCustomList <T>(string key, string field, List <T> defaultVal) where T : IGDEData { List <T> retVal = defaultVal; try { Dictionary <string, object> dict; if (ModifiedData.TryGetValue(key, out dict) && dict.ContainsKey(field)) { retVal = new List <T>(); List <string> customDataKeys = GDEDataManager.GetStringList(key, field, null); if (customDataKeys != null) { foreach (string customDataKey in customDataKeys) { retVal.Add((T)Activator.CreateInstance(typeof(T), new object[] { customDataKey })); } } } } catch (Exception ex) { Debug.LogException(ex); } return(retVal); }
public static List <T> GetCustomList <T>(string key, List <T> defaultVal) where T : IGDEData, new() { List <T> retVal = defaultVal; try { if (PlayerPrefs.HasKey(key)) { retVal = new List <T>(); List <string> customDataKeys = GDEDataManager.GetStringList(key, null); if (customDataKeys != null) { foreach (string customDataKey in customDataKeys) { T temp; if (GDEDataManager.DataDictionary.TryGetCustom(customDataKey, out temp)) { retVal.Add(temp); } } } } } catch (Exception ex) { Debug.LogException(ex); } return(retVal); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; _TestInt = GDEDataManager.GetInt(_key, TestIntKey, _TestInt); _TestString = GDEDataManager.GetString(_key, TestStringKey, _TestString); _TestSchema = GDEDataManager.GetCustom(_key, TestSchemaKey, _TestSchema); TestList = GDEDataManager.GetStringList(_key, TestListKey, TestList); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; bool_list_field = GDEDataManager.GetBoolList(_key + "_" + bool_list_fieldKey, bool_list_field); int_list_field = GDEDataManager.GetIntList(_key + "_" + int_list_fieldKey, int_list_field); float_list_field = GDEDataManager.GetFloatList(_key + "_" + float_list_fieldKey, float_list_field); string_list_field = GDEDataManager.GetStringList(_key + "_" + string_list_fieldKey, string_list_field); vector2_list_field = GDEDataManager.GetVector2List(_key + "_" + vector2_list_fieldKey, vector2_list_field); vector3_list_field = GDEDataManager.GetVector3List(_key + "_" + vector3_list_fieldKey, vector3_list_field); vector4_list_field = GDEDataManager.GetVector4List(_key + "_" + vector4_list_fieldKey, vector4_list_field); color_list_field = GDEDataManager.GetColorList(_key + "_" + color_list_fieldKey, color_list_field); custom_list_field = GDEDataManager.GetCustomList(_key + "_" + custom_list_fieldKey, custom_list_field); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; _NotNormalPool = GDEDataManager.GetBool(_key, NotNormalPoolKey, _NotNormalPool); _Unable = GDEDataManager.GetBool(_key, UnableKey, _Unable); _AltarTimes = GDEDataManager.GetInt(_key, AltarTimesKey, _AltarTimes); _PoolCapacity = GDEDataManager.GetInt(_key, PoolCapacityKey, _PoolCapacity); _GetSNum = GDEDataManager.GetInt(_key, GetSNumKey, _GetSNum); _lasttime = GDEDataManager.GetFloat(_key, lasttimeKey, _lasttime); _Name = GDEDataManager.GetString(_key, NameKey, _Name); _ID = GDEDataManager.GetString(_key, IDKey, _ID); _starttime = GDEDataManager.GetString(_key, starttimeKey, _starttime); AllHeroes = GDEDataManager.GetStringList(_key, AllHeroesKey, AllHeroes); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; _keepWorking = GDEDataManager.GetBool(_key, keepWorkingKey, _keepWorking); _isEmpty = GDEDataManager.GetBool(_key, isEmptyKey, _isEmpty); _timeType = GDEDataManager.GetInt(_key, timeTypeKey, _timeType); _oldData = GDEDataManager.GetInt(_key, oldDataKey, _oldData); _newData = GDEDataManager.GetInt(_key, newDataKey, _newData); _itemHashcode = GDEDataManager.GetInt(_key, itemHashcodeKey, _itemHashcode); _itemId = GDEDataManager.GetString(_key, itemIdKey, _itemId); _startTime = GDEDataManager.GetString(_key, startTimeKey, _startTime); _taskId = GDEDataManager.GetString(_key, taskIdKey, _taskId); taskRewards = GDEDataManager.GetStringList(_key, taskRewardsKey, taskRewards); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; _bool_field = GDEDataManager.GetBool(_key, bool_fieldKey, _bool_field); _int_field = GDEDataManager.GetInt(_key, int_fieldKey, _int_field); _float_field = GDEDataManager.GetFloat(_key, float_fieldKey, _float_field); _string_field = GDEDataManager.GetString(_key, string_fieldKey, _string_field); _vector2_field = GDEDataManager.GetVector2(_key, vector2_fieldKey, _vector2_field); _vector3_field = GDEDataManager.GetVector3(_key, vector3_fieldKey, _vector3_field); _vector4_field = GDEDataManager.GetVector4(_key, vector4_fieldKey, _vector4_field); _color_field = GDEDataManager.GetColor(_key, color_fieldKey, _color_field); _custom_field = GDEDataManager.GetCustom(_key, custom_fieldKey, _custom_field); bool_list_field = GDEDataManager.GetBoolList(_key, bool_list_fieldKey, bool_list_field); int_list_field = GDEDataManager.GetIntList(_key, int_list_fieldKey, int_list_field); float_list_field = GDEDataManager.GetFloatList(_key, float_list_fieldKey, float_list_field); string_list_field = GDEDataManager.GetStringList(_key, string_list_fieldKey, string_list_field); vector2_list_field = GDEDataManager.GetVector2List(_key, vector2_list_fieldKey, vector2_list_field); vector3_list_field = GDEDataManager.GetVector3List(_key, vector3_list_fieldKey, vector3_list_field); vector4_list_field = GDEDataManager.GetVector4List(_key, vector4_list_fieldKey, vector4_list_field); color_list_field = GDEDataManager.GetColorList(_key, color_list_fieldKey, color_list_field); }
public override void LoadFromSavedData(string dataKey) { _key = dataKey; cust_string_list = GDEDataManager.GetStringList(_key, cust_string_listKey, cust_string_list); }