public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(bool_fieldKey, out _bool_field); dict.TryGetInt(int_fieldKey, out _int_field); dict.TryGetFloat(float_fieldKey, out _float_field); dict.TryGetString(string_fieldKey, out _string_field); dict.TryGetVector2(vector2_fieldKey, out _vector2_field); dict.TryGetVector3(vector3_fieldKey, out _vector3_field); dict.TryGetVector4(vector4_fieldKey, out _vector4_field); dict.TryGetColor(color_fieldKey, out _color_field); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); _custom_field = new GDEReadSceneUnityTypesData(customDataKey); dict.TryGetBoolList(bool_list_fieldKey, out bool_list_field); dict.TryGetIntList(int_list_fieldKey, out int_list_field); dict.TryGetFloatList(float_list_fieldKey, out float_list_field); dict.TryGetStringList(string_list_fieldKey, out string_list_field); dict.TryGetVector2List(vector2_list_fieldKey, out vector2_list_field); dict.TryGetVector3List(vector3_list_fieldKey, out vector3_list_field); dict.TryGetVector4List(vector4_list_fieldKey, out vector4_list_field); dict.TryGetColorList(color_list_fieldKey, out color_list_field); LoadFromSavedData(dataKey); } }
public void Reset_custom_field() { GDEDataManager.ResetToDefault(_key, custom_fieldKey); Dictionary <string, object> dict; GDEDataManager.Get(_key, out dict); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); _custom_field = new GDEReadSceneUnityTypesData(customDataKey); custom_field.ResetAll(); }
public void Reset_custom_field() { GDEDataManager.ResetToDefault(_key, custom_fieldKey); Dictionary <string, object> dict; GDEDataManager.Get(_key, out dict); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); GDEDataManager.DataDictionary.TryGetCustom(customDataKey, out _custom_field); custom_field = GDEDataManager.GetCustom(_key + "_" + custom_fieldKey, _custom_field); custom_field.ResetAll(); }
public GDEReadSceneUnityTypesData ShallowClone() { string newKey = Guid.NewGuid().ToString(); GDEReadSceneUnityTypesData newClone = new GDEReadSceneUnityTypesData(newKey); Dictionary <string, object> dict; GDEDataManager.Get(_key, out dict); string path; dict.TryGetString(go_fieldKey, out path); GDEDataManager.SetString(newClone.Key, go_fieldKey, path); newClone.go_field = go_field; dict.TryGetString(tex_fieldKey, out path); GDEDataManager.SetString(newClone.Key, tex_fieldKey, path); newClone.tex_field = tex_field; dict.TryGetString(mat_fieldKey, out path); GDEDataManager.SetString(newClone.Key, mat_fieldKey, path); newClone.mat_field = mat_field; dict.TryGetString(aud_fieldKey, out path); GDEDataManager.SetString(newClone.Key, aud_fieldKey, path); newClone.aud_field = aud_field; dict.TryGetString(vid_fieldKey, out path); GDEDataManager.SetString(newClone.Key, vid_fieldKey, path); newClone.vid_field = vid_field; List <string> pathList; dict.TryGetStringList(go_list_fieldKey, out pathList); GDEDataManager.SetStringList(newClone.Key, go_list_fieldKey, pathList); newClone.go_list_field = new List <GameObject>(go_list_field); newClone.Set_go_list_field(); return(newClone); }
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; _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 GDEReadSceneUnityTypesData DeepClone() { GDEReadSceneUnityTypesData newClone = ShallowClone(); return(newClone); }