Exemplo n.º 1
0
        public static void GUI(EditorClass info, string searchKeyword = "", MemberFilter memberFilter = MemberFilter.All, AccessModifier accessModifier = AccessModifier.All, InstanceType instanceType = InstanceType.Instance, bool isGet = false, bool isSet = false)
        {
            EditorGUI.indentLevel = info.level;

            if (info.level != -1)
            {
                info.isFold = EditorGUILayout.Foldout(info.isFold, info.name);
            }

            if (info.isFold)
            {
                if (memberFilter == MemberFilter.All || memberFilter == MemberFilter.Fields)
                {
                    for (int i = 0; i < info.editorFields.Count; i++)
                    {
                        EditorField editorField = info.editorFields[i];

                        EditorField.GUI(editorField, searchKeyword, accessModifier, instanceType);
                    }
                }

                if (memberFilter == MemberFilter.All || memberFilter == MemberFilter.Methods)
                {
                    for (int i = 0; i < info.editorMethods.Count; i++)
                    {
                        EditorMethod editorMethod = info.editorMethods[i];

                        EditorMethod.GUI(editorMethod, searchKeyword, accessModifier, instanceType, isGet, isSet);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void GetEditorMethod()
        {
            classInfo.GetMethod();

            for (int i = 0; i < classInfo.methods.Count; i++)
            {
                MethodData method = classInfo.methods[i];

                EditorMethod editorMethod = new EditorMethod(method, level + 1);

                editorMethods.Add(editorMethod);
            }
        }
Exemplo n.º 3
0
        public static void GUI(EditorMethod editorMethod, string searchKeyword = "", AccessModifier accessModifier = AccessModifier.All, InstanceType instanceType = InstanceType.Instance, bool isGet = false, bool isSet = false)
        {
            if (accessModifier != AccessModifier.All && editorMethod.methodData.accessModifier != accessModifier)
            {
                return;
            }

            if (instanceType != InstanceType.All && editorMethod.methodData.instanceType != instanceType)
            {
                return;
            }

            if (searchKeyword != string.Empty && editorMethod.methodData.name.ToLower().Contains(searchKeyword) == false)
            {
                return;
            }

            if (isGet == false && editorMethod.methodData.isGet == true)
            {
                return;
            }

            if (isSet == false && editorMethod.methodData.isSet == true)
            {
                return;
            }

            for (int i = 0; i < editorMethod.editorParameters.Count; i++)
            {
                EditorParameter editorParameter = editorMethod.editorParameters[i];

                EditorParameter.GUI(editorParameter);
            }

            if (GUILayout.Button(editorMethod.methodData.name))
            {
                editorMethod.methodData.methodInfo.Invoke(editorMethod.methodData.instance, editorMethod.methodData.GetParameters());
            }
        }