Exemplo n.º 1
0
        public void SelectTab(TabButton button)
        {
            if (selectedTab != null)
            {
                selectedTab.Deselect();
            }

            selectedTab = button;
            selectedTab.Select();
            ResetTabs();

            if (dynamicTextColor)
            {
                button.text.color = activeColor;
            }

            switch (transitionType)
            {
            case TabTransitionType.Color:
                button.background.color = tabActiveColor;
                break;

            case TabTransitionType.Sprite:
                button.background.sprite = tabActiveSprite;
                break;

            case TabTransitionType.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var index = button.transform.GetSiblingIndex();

            for (var i = 0; i < pageGroup.pages.Length; i++)
            {
                if (i == index)
                {
                    pageGroup.ShowPage(i);
                }
            }
        }
Exemplo n.º 2
0
 public void Subscribe(TabButton button)
 {
     tabButtons.Add(button);
 }
Exemplo n.º 3
0
 public void OnTabExit(TabButton button)
 {
     ResetTabs();
 }