Exemplo n.º 1
0
    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!");
        }
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 public override void UpdateAll()
 {
     _lastActiveTab.UpdateAll();
 }