private static void FindMarkingMethod(Type type, UpdatableComponentInfo_Editor updatableComponentInfo)
        {
            var markingMethods =
                from methodInfo in type.GetMethods(BindingFlags.Public | BindingFlags.Instance)
                where methodInfo.GetParameters().Length == 0 &&
                methodInfo.GetCustomAttribute <MarkingActionAttribute>() is MarkingActionAttribute invokeActionAttribute &&
                (invokeActionAttribute.IsEditorAction || invokeActionAttribute.IsRuntimeAction)
                select(methodInfo: methodInfo, markingActionAttribute: methodInfo.GetCustomAttribute <MarkingActionAttribute>());

            foreach ((MethodInfo methodInfo, MarkingActionAttribute markingActionAttribute)item in markingMethods)
            {
                MarkingMethod markingMethod = new MarkingMethod()
                {
                    IsEditorAction  = item.markingActionAttribute.IsEditorAction,
                    IsRuntimeAction = item.markingActionAttribute.IsRuntimeAction,
                    Name            = item.methodInfo.Name,
                    Title           = item.markingActionAttribute.Title ?? item.methodInfo.Name,
                };
                updatableComponentInfo.MarkingMethods.Add(markingMethod);
            }
            updatableComponentInfo.MarkingMethods.Sort();
        }
        /// <summary>
        /// 基于类型和特性信息,导出自定义组件信息
        /// </summary>
        /// <param name="updatableComponentsType">类型和特性</param>
        /// <returns>自定义组件信息</returns>
        public static UpdatableComponentInfo_Editor[] FromTypeToInfo(KeyValuePair <Type, BindingUpdatableComponentAttribute>[] updatableComponentsType)
        {
            if (updatableComponentsType is null)
            {
                throw new ArgumentNullException(nameof(updatableComponentsType));
            }

            UpdatableComponentInfo_Editor[] customComponentInfos = new UpdatableComponentInfo_Editor[updatableComponentsType.Length];
            for (int index = 0; index < updatableComponentsType.Length; index++)
            {
                Type type = updatableComponentsType[index].Key;
                UpdatableComponentInfo_Editor updatableComponentInfo = customComponentInfos[index] = new UpdatableComponentInfo_Editor()
                {
                    BindingComponentName = updatableComponentsType[index].Value.BindingComponentName,
                    TypeFullName         = type.FullName,
                };
                FindSerializeItem(type, updatableComponentInfo);
                FindMarkingMethod(type, updatableComponentInfo);

                updatableComponentInfo.SerializeItems.Sort();
            }

            return(customComponentInfos);
        }
        private static void FindSerializeItem(Type type, UpdatableComponentInfo_Editor updatableComponentInfo)
        {
            int defaultOrder = 0;

            foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
            {
                if (!(fieldInfo.GetCustomAttribute <InspectorInfoAttribute>() is InspectorInfoAttribute inspectorInfo))
                {
                    continue;
                }
                string title = inspectorInfo.Title ?? fieldInfo.Name;
                if (title.StartsWith("m_") && title.Length > 2)
                {
                    title = title.Substring(2);
                }
                bool isUnityObject    = fieldInfo.FieldType.IsSubclassOf(typeof(UnityEngine.Object));
                bool isSerizlableType = fieldInfo.FieldType.IsValueType ||
                                        (fieldInfo.FieldType.IsClass && fieldInfo.FieldType.GetCustomAttribute <SerializableAttribute>(true) != null);
                bool needSerialize;
                if (inspectorInfo.State == ItemSerializableState.Default)
                {
                    needSerialize = fieldInfo.IsPublic;
                }
                else
                {
                    needSerialize = inspectorInfo.State == ItemSerializableState.SerializeIt;
                }

                SerializeItem fieldItem = new SerializeItem()
                {
                    Name              = fieldInfo.Name,
                    Order             = inspectorInfo.Order < 0 ? defaultOrder : inspectorInfo.Order,
                    TypeFullName      = fieldInfo.FieldType.FullName,
                    Title             = title,
                    ToolTip           = inspectorInfo.ToolTip ?? string.Empty,
                    IsField           = true,
                    IsProperty        = false,
                    UseUnitySerialize = needSerialize && isUnityObject,
                    UseJsonSerialize  = needSerialize && isSerizlableType,
                };
                updatableComponentInfo.SerializeItems.Add(fieldItem);
                defaultOrder++;
            }

            foreach (PropertyInfo propertyInfo in type.GetProperties(BindingFlags.Instance | BindingFlags.Public))
            {
                if (!(propertyInfo.GetCustomAttribute <InspectorInfoAttribute>() is InspectorInfoAttribute inspectorInfo))
                {
                    continue;
                }

                bool isUnityObject    = propertyInfo.PropertyType.IsSubclassOf(typeof(UnityEngine.Object));
                bool isSerizlableType = propertyInfo.PropertyType.IsValueType ||
                                        (propertyInfo.PropertyType.IsClass && propertyInfo.PropertyType.GetCustomAttribute <SerializableAttribute>(true) != null);
                bool needSerialize;
                if (inspectorInfo.State == ItemSerializableState.Default)
                {
                    needSerialize = true;
                }
                else
                {
                    needSerialize = inspectorInfo.State == ItemSerializableState.SerializeIt;
                }
                Console.WriteLine($"{propertyInfo.Name}, canSerialize : {needSerialize}, {isSerizlableType}, ");

                SerializeItem fieldItem = new SerializeItem()
                {
                    Name              = propertyInfo.Name,
                    Order             = inspectorInfo.Order < 0 ? defaultOrder : inspectorInfo.Order,
                    TypeFullName      = propertyInfo.PropertyType.FullName,
                    Title             = inspectorInfo.Title ?? propertyInfo.Name,
                    IsField           = false,
                    IsProperty        = true,
                    UseUnitySerialize = needSerialize && isUnityObject,
                    UseJsonSerialize  = needSerialize && isSerizlableType,
                };
                updatableComponentInfo.SerializeItems.Add(fieldItem);
                defaultOrder++;
            }
        }