Example #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //draw the list using GUILayout, you can of course specify your own position and label
            list1.DoLayoutList();
            serializedObject.ApplyModifiedProperties();

            GUILayout.Space(5);

            Setting.MakeHorizontal(50, () =>
            {
                if (GUILayout.Button("自动获取fields", GUILayout.Height(30)))
                {
                    DoConvert(target as ClassBind);
                }
            });

            GUILayout.Space(5);

            Setting.MakeHorizontal(50, () =>
            {
                if (GUILayout.Button("自动更新fieldType", GUILayout.Height(30)))
                {
                    DoFieldType(target as ClassBind);
                }
            });


            GUILayout.Space(15);
        }
Example #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            _classBinds.DoLayoutList();
            serializedObject.ApplyModifiedProperties();

            GUILayout.Space(5);

            Setting.MakeHorizontal(50, () =>
            {
                if (GUILayout.Button(Setting.GetString(SettingString.ClassBindGetAllField), GUILayout.Height(30)))
                {
                    DoConvert(target as ClassBind);
                }
            });

            GUILayout.Space(5);

            Setting.MakeHorizontal(50, () =>
            {
                if (GUILayout.Button(Setting.GetString(SettingString.ClassBindGetAllType), GUILayout.Height(30)))
                {
                    DoFieldType(target as ClassBind);
                }
            });


            GUILayout.Space(15);
        }
Example #3
0
        private void OnGUI()
        {
            //绘制标题
            GUILayout.Space(10);
            GUI.skin.label.fontSize  = 24;
            GUI.skin.label.alignment = TextAnchor.MiddleCenter;
            GUILayout.Label("ILRuntime适配器生成");
            GUI.skin.label.fontSize = 18;
            GUILayout.Label("ILRuntime Adapter Generator");

            //介绍
            EditorGUILayout.HelpBox("本地工程类(没生成asmdef的),Assembly一栏不需要改,Class name一栏写类名(有命名空间带上);\n" +
                                    "有生成asmdef的工程类,Assembly一栏写asmdef里写的名字,Class name一栏写类名(有命名空间带上);\n" +
                                    "最后的Namespace是生成的适配器的命名空间,随便写,只要在适配器Helper引用激活即可\n\n" +
                                    "如果要生成Unity类的适配器,请确定找到了对应的module,并添加进热更工程,HotUpdateScripts/Dlls文件夹内,不然无法获取",
                                    MessageType.Info);

            //程序集
            GUILayout.Space(50);
            Setting.MakeHorizontal(25, () => { EditorGUILayout.LabelField("Assembly 类的程序集"); });
            Setting.MakeHorizontal(25, () => { _assembly = EditorGUILayout.TextField("", _assembly); });

            //类名
            GUILayout.Space(10);
            Setting.MakeHorizontal(25, () => { _class = EditorGUILayout.TextField("Class name 类名", _class); });

            //命名空间
            GUILayout.Space(10);
            Setting.MakeHorizontal(25,
                                   () => { EditorGUILayout.LabelField("Namespace for generated adapter 生成适配器的命名空间"); });
            Setting.MakeHorizontal(25, () => { _namespace = EditorGUILayout.TextField("", _namespace); });

            //生成
            GUILayout.Space(10);
            Setting.MakeHorizontal(25, () =>
            {
                if (GUILayout.Button("Generate 生成"))
                {
                    GenAdapter();
                }
            });
        }