public void OnTabExit(UITabButton tabButton) { if (tapButtons == null) { return; } ResetTabs(); }
public void Subscribe(UITabButton tabButton) { if (tapButtons == null) { tapButtons = new List <UITabButton>(); } tapButtons.Add(tabButton); }
void ResetTabs(UITabButton tabButton = null) { foreach (var item in tapButtons) { if (item == selectedTabButton || item == tabButton) { continue; } item.background.sprite = tabIdle; } }
public void OnTabEnter(UITabButton tabButton) { if (tapButtons == null) { return; } if (selectedTabButton != null && selectedTabButton != tabButton) { selectedTabButton.background.sprite = tabHover; } ResetTabs(tabButton); }
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(); }