void OnGUI()
        {
            EditorGUILayout.ObjectField(instance as UnityEngine.Object, instance.GetType(), true);

            if (editorInstance == null)
            {
                editorInstance = new EditorInstance(instance);
            }

            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            editorInstance.memberFilter = (MemberFilter)EditorGUILayout.EnumPopup("成员过滤", editorInstance.memberFilter);

            editorInstance.accessModifier = (AccessModifier)EditorGUILayout.EnumPopup("修饰符过滤", editorInstance.accessModifier);

            editorInstance.instanceType = (InstanceType)EditorGUILayout.EnumPopup("实例静态过滤", editorInstance.instanceType);

            editorInstance.isGet = EditorGUILayout.Toggle("Get", editorInstance.isGet);
            editorInstance.isSet = EditorGUILayout.Toggle("Set", editorInstance.isSet);

            editorInstance.searchKeyword = EditorGUILayout.TextField("搜索过滤", editorInstance.searchKeyword);

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorClass.GUI(editorInstance.info, editorInstance.searchKeyword.ToLower(), editorInstance.memberFilter, editorInstance.accessModifier, editorInstance.instanceType, editorInstance.isGet, editorInstance.isSet);

            EditorGUILayout.EndScrollView();
        }
Esempio n. 2
0
        public static void GUI(EditorObject info)
        {
            EditorGUI.indentLevel = info.level;

            if (info.editorList != null)
            {
                EditorList.GUI(info.editorList);
            }
            else if (info.editorArray != null)
            {
                EditorArray.GUI(info.editorArray);
            }
            else if (info.editorDictionary != null)
            {
                EditorDictionary.GUI(info.editorDictionary);
            }
            else if (info.editorClass != null)
            {
                EditorClass.GUI(info.editorClass);
            }
            else
            {
                object value = info.objectData.GetValue();

                bool isChange = false;

                InputTool.Input(info.objectData.type, info.name, ref value, ref isChange);

                if (isChange)
                {
                    info.objectData.SetValue(value);
                }
            }
        }
Esempio n. 3
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            Refresh();

            if (editorInstance == null)
            {
                return;
            }

            //EditorGUILayout.Space();
            //EditorGUILayout.Space();

            editorInstance.isFold = EditorGUILayout.Foldout(editorInstance.isFold, "过滤选项");


            if (editorInstance.isFold)
            {
                editorInstance.memberFilter = (MemberFilter)EditorGUILayout.EnumPopup("成员过滤", editorInstance.memberFilter);

                editorInstance.accessModifier = (AccessModifier)EditorGUILayout.EnumPopup("修饰符过滤", editorInstance.accessModifier);

                editorInstance.instanceType = (InstanceType)EditorGUILayout.EnumPopup("实例静态过滤", editorInstance.instanceType);

                editorInstance.isGet = EditorGUILayout.Toggle("Get", editorInstance.isGet);
                editorInstance.isSet = EditorGUILayout.Toggle("Set", editorInstance.isSet);

                editorInstance.searchKeyword = EditorGUILayout.TextField("搜索过滤", editorInstance.searchKeyword);
            }


            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorClass.GUI(editorInstance.info, editorInstance.searchKeyword.ToLower(), editorInstance.memberFilter, editorInstance.accessModifier, editorInstance.instanceType, editorInstance.isGet, editorInstance.isSet);
        }