protected override void PreprocessComponent(Component comp)
        {
            UITabHandler h = comp as UITabHandler;

            if (h.tabs.IsNotEmpty())
            {
                foreach (var t in h.tabs)
                {
                    t.uiRoot.SetActiveEx(false);
                }
            }
        }
예제 #2
0
        public UITabHandlerInspectorImpl(UITabHandler handler)
        {
            this.tabHandler                 = handler;
            tabArrInspector                 = new UITabArrInspector(tabHandler, "tabs", true);
            tabPrefabArrInspector           = new UITabArrInspector(tabHandler, "tabPrefabs", false);
            tabPrefabArrInspector.selectTab = false;
            tabButtonArrInspector           = new ObjReorderList <UIButton>(tabHandler, "tabButtons");
            bool auto = false;
//            if (auto) {
//				tabButtonArrInspector.drawer.onAddCallback +=
//                tabArrInspector.AddItemAddCallback(OnTabChanged);
//                tabArrInspector.AddItemChangeCallback(OnTabChanged);
//                tabArrInspector.AddItemRemoveCallback(OnTabRemoved);
//            }
        }
예제 #3
0
        void OnEnable()
        {
            inspector = new UIWindowInspectorImpl(target as UIWindow);
            UIWindow  win   = target as UIWindow;
            PopupBase popup = win.GetComponent <PopupBase>();

            if (popup != null)
            {
                UITabHandler tab = popup.GetComponentInChildrenEx <UITabHandler>();
                if (tab != null)
                {
                    popup.tabs = tab;
                    CompatibilityEditor.SetDirty(popup);
                }
            }
        }
예제 #4
0
        public UITabHandlerInspectorImpl(UITabHandler handler)
        {
            this.tabHandler                 = handler;
            tabArrInspector                 = new UITabArrInspector(tabHandler, "tabs", true);
            tabPrefabArrInspector           = new UITabArrInspector(tabHandler, "tabPrefabs", false);
            tabPrefabArrInspector.selectTab = false;
            tabButtonArrInspector           = new ArrayDrawer <UIButton>(tabHandler, "tabButtons");
            bool auto = false;

            if (auto)
            {
                tabArrInspector.AddItemAddCallback(OnTabChanged);
                tabArrInspector.AddItemChangeCallback(OnTabChanged);
                tabArrInspector.AddItemRemoveCallback(OnTabRemoved);
            }
        }
        public UITabHandlerInspectorImpl(UITabHandler handler)
        {
            var sObj = new SerializedObject(handler);

            this.tabHandler                 = handler;
            tabArrInspector                 = new UITabArrInspector(tabHandler, "tabs", true);
            tabPrefabArrInspector           = new UITabArrInspector(tabHandler, "tabPrefabs", false);
            tabPrefabArrInspector.selectTab = false;
            tabButtonArrInspector           = new ReorderableList(sObj, sObj.FindProperty("tabButtons"));
            bool auto = false;
//            if (auto) {
//				tabButtonArrInspector.drawer.onAddCallback +=
//                tabArrInspector.AddItemAddCallback(OnTabChanged);
//                tabArrInspector.AddItemChangeCallback(OnTabChanged);
//                tabArrInspector.AddItemRemoveCallback(OnTabRemoved);
//            }
        }
예제 #6
0
 public UITabArrInspector(UITabHandler handler, string varName, bool allowSceneObj) : base(handler, varName, allowSceneObj)
 {
     this.tabHandler = handler;
     this.SetTitle(varName);
     AddItemChangeCallback(OnItemChange);
 }