Exemple #1
0
    public void SwitchTab(int id)
    {
        if (selectedTab == tabButtons[id])
        {
            return;
        }

        if (id == 2)
        {
            tabButtons[2].GetComponent <Button>().interactable = true;
        }

        foreach (var item in tabs)
        {
            item.SetActive(false);
        }
        tabs[id].SetActive(true);
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }
        selectedTab = tabButtons[id];
        selectedTab.Select();
        currentTab = id;
    }