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

            GUILayout.BeginVertical();
            GUILayout.Space(5);


            GUILayout.BeginHorizontal();
            if (GUILayout.Button("根据ComponentTypeEnum创建Tag", GUILayout.Height(25)))
            {
                mUGUIComponentReference.AddAllUGUIComponentTypeTag();
            }

            if (GUILayout.Button("移除没有预定义的Tags", GUILayout.Height(25)))
            {
                mUGUIComponentReference.RemoveAllUnDefineComponentTag();
            }

            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            if (GUILayout.Button("自动重新映射UITags", GUILayout.Height(25)))
            {
                mUGUIComponentReference.AutoReMapTags();
                Undo.RegisterFullObjectHierarchyUndo(mUGUIComponentReference.gameObject, "AutoReMapTag");
            }

            if (GUILayout.Button("自动关联多语言key", GUILayout.Height(25)))
            {
                mUGUIComponentReference.AutoConnectLocalizationKeyComponent();
                mUGUIComponentReference.AutoRecordLocalizationKeyComponent();
                Undo.RegisterFullObjectHierarchyUndo(mUGUIComponentReference.gameObject, "AutoSerlizeLocalizationKey");
            }

            GUILayout.EndHorizontal();

            if (GUILayout.Button("自动序列化标记Tag 的组件&设置序列化组件对象的Tag", GUILayout.Height(25)))
            {
                mUGUIComponentReference.AutoRecordReferenceWithTag();
                mUGUIComponentReference.AutoSetSerializaComponentTag();
                Undo.RegisterFullObjectHierarchyUndo(mUGUIComponentReference.gameObject, "SerializeTgs");
            }


            if (GUILayout.Button("检测是否有重名的对象", GUILayout.Height(25)))
            {
                mUGUIComponentReference.CheckIfContainSameNameComponent();
            }

            if (GUILayout.Button("获取当前对象的UI定义", GUILayout.Height(25)))
            {
                UGUIComponentReference.ShowComponentReferenceByConfig(mUGUIComponentReference.gameObject);
            }

            GUILayout.Space(5);
            GUILayout.EndVertical();


            DrawSerilizeUGUIComponent();
            DrawAllLocalizationKeyComponents();

            serializedObject.ApplyModifiedProperties();
            //       base.OnInspectorGUI();
        }
Beispiel #2
0
 private void OnEnable()
 {
     mSerilizeUGUIComponents       = serializedObject.FindProperty("mSerilizeUGUIComponents");
     mAllLocalizationKeyComponents = serializedObject.FindProperty("mAllLocalizationKeyComponents");
     mUGUIComponentReference       = target as UGUIComponentReference;
 }