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); } } }
public void Subscribe(TabButton button) { tabButtons.Add(button); }
public void OnTabExit(TabButton button) { ResetTabs(); }