Exemple #1
0
        public void OnTabExit(UITabButton tabButton)
        {
            if (tapButtons == null)
            {
                return;
            }

            ResetTabs();
        }
Exemple #2
0
        public void Subscribe(UITabButton tabButton)
        {
            if (tapButtons == null)
            {
                tapButtons = new List <UITabButton>();
            }

            tapButtons.Add(tabButton);
        }
Exemple #3
0
        void ResetTabs(UITabButton tabButton = null)
        {
            foreach (var item in tapButtons)
            {
                if (item == selectedTabButton || item == tabButton)
                {
                    continue;
                }

                item.background.sprite = tabIdle;
            }
        }
Exemple #4
0
        public void OnTabEnter(UITabButton tabButton)
        {
            if (tapButtons == null)
            {
                return;
            }

            if (selectedTabButton != null && selectedTabButton != tabButton)
            {
                selectedTabButton.background.sprite = tabHover;
            }

            ResetTabs(tabButton);
        }
Exemple #5
0
        public void OnTabSelected(UITabButton tabButton)
        {
            if (tapButtons == null)
            {
                return;
            }

            if (selectedTabButton != null)
            {
                selectedTabButton.Deselect();
            }

            selectedTabButton = tabButton;
            selectedTabButton.background.sprite = tabActive;

            int index = selectedTabButton.transform.GetSiblingIndex();

            if (panelGroup != null)
            {
                panelGroup.SetPanelIndex(selectedTabButton.transform.GetSiblingIndex());
            }

            ResetTabs();
        }