Example #1
0
        public override void LoadFromDict(string dataKey, Dictionary<string, object> dict)
        {
            _key = dataKey;

            if (dict == null)
                LoadFromSavedData(dataKey);
            else
            {
                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);

                dict.TryGetCustomList(custom_list_fieldKey, out custom_list_field);
                LoadFromSavedData(dataKey);
            }
        }
        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);
                GDEDataManager.DataDictionary.TryGetCustom(customDataKey, out _custom_field);

                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);
            }
        }