public void SwitchTab(int i) { if (_lastActiveTab != null) { _lastActiveTab.gameObject.SetActive(false); } MainMenuTab desiredUI = _tabs[i]; if (desiredUI != null) { desiredUI.gameObject.SetActive(true); desiredUI.UpdateAll(); _lastActiveTab = desiredUI; } else { Debug.LogError("Can't find the ui object!"); } }
public MainMenuTab SwitchTab(MainTabType type) { if (_lastActiveTab != null) { _lastActiveTab.gameObject.SetActive(false); } MainMenuTab desiredUI = _tabs.Find(t => t.Tab == type); if (desiredUI != null) { desiredUI.gameObject.SetActive(true); desiredUI.UpdateAll(); _lastActiveTab = desiredUI; } else { Debug.LogError("Can't find the ui object!"); } return(desiredUI); }
public override void UpdateAll() { _lastActiveTab.UpdateAll(); }