Beispiel #1
0
        void OnGUI()
        {
            GUILayout.BeginVertical();
            {
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("请输入类名:", GUILayout.Width(80));
                    m_uiValueClassName = GUILayout.TextField(m_uiValueClassName, GUILayout.Width(350));
                }
                GUILayout.EndHorizontal();

                blockPosition = EditorGUILayout.BeginScrollView(blockPosition, GUILayout.Width(Screen.width), GUILayout.ExpandWidth(true));

                Dictionary <string, CustomExportBlock> blockMap = CustomExportBlockTool.GetInstance().BlockMap;
                foreach (var pair in blockMap)
                {
                    if (GUILayout.Button(pair.Value.className))
                    {
                        m_uiValueClassName = pair.Value.className;
                    }
                }

                EditorGUILayout.EndScrollView();

                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("查看构造函数"))
                    {
                        FillConstructorData(m_uiValueClassName);
                    }

                    if (GUILayout.Button("查看成员方法"))
                    {
                        FillMethodData(m_uiValueClassName);
                    }
                }
                GUILayout.EndHorizontal();

                scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition, GUILayout.Width(Screen.width), GUILayout.ExpandHeight(true));

                foreach (var info in paramList)
                {
                    info.OnGUI();
                }
                EditorGUILayout.EndScrollView();
            }
            GUILayout.EndVertical();
        }
Beispiel #2
0
            private void renderMethod(MethodBase methodBase)
            {
                ParameterInfo[] infos = methodBase.GetParameters();
                if (infos.Length > 0)
                {
                    GUILayout.BeginHorizontal();
                    foreach (var pInfo in infos)
                    {
                        EditorGUILayout.SelectableLabel(pInfo.ParameterType.Name);
                    }
                    GUILayout.EndHorizontal();
                }
                else
                {
                    EditorGUILayout.SelectableLabel("无参数");
                }

                bool   isBlock = CustomExportBlockTool.GetInstance().IsValidMethodInfo(classType.FullName, methodBase);
                string desc    = "屏蔽导出";

                if (isBlock)
                {
                    desc = "取消屏蔽";
                }
                if (GUILayout.Button(desc))
                {
                    if (isBlock)
                    {
                        CustomExportBlockTool.GetInstance().AddBlockClass(classType, methodBase);
                    }
                    else
                    {
                        CustomExportBlockTool.GetInstance().RemoveBlockClass(classType, methodBase);
                    }
                }
            }
Beispiel #3
0
 private void OnEnable()
 {
     CustomExportBlockTool.GetInstance().LoadJson();
 }