Example #1
0
    public void OnTabSelected(TabButton button)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = button;
        selectedTab.Select();
        ResetTabs();

        button.background.sprite = tabActive;
        int index = button.transform.GetSiblingIndex();

        currentTabButtonIndex = index;
        for (int i = 0; i < objectsToSwap.Count; ++i)
        {
            if (i == index)
            {
                objectsToSwap[i].SetActive(true);
            }
            else
            {
                objectsToSwap[i].SetActive(false);
            }
        }

        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(index);
        }
    }
Example #2
0
    public void OnTabSelected(NewTabButton button)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = button;

        selectedTab.Select();

        ResetTabs();
        // button.background.color = tabActive;
        StartCoroutine(BlendColors(button.background, tabActive));
        // int index = button.transform.GetSiblingIndex();


        // for (int i = 0; i < objectsToSwap.Count; i++)
        // {
        //     if (i == index)
        //         objectsToSwap[i].SetActive(true);
        //     else
        //         objectsToSwap[i].SetActive(false);
        // }
        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(selectedTab.transform.GetSiblingIndex());
        }
    }
Example #3
0
    public void OnTabSelected(TabButton button)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = button;

        selectedTab.Select();

        ResetTabs();
        button.background.color = tabActive;
        int index = button.transform.GetSiblingIndex();

        //for (int i = 0; i < objectsToSwap.Count; i++)
        //{
        //    if (i == index) objectsToSwap[i].SetActive(true);
        //    else objectsToSwap[i].SetActive(false);

        //}

        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(index);
        }
    }
Example #4
0
    public void OnTabSelected(TabButton tab)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = tab;
        selectedTab.Select();

        ResetTabs();
        tab.background.color = tab.buttonColors.colorActive;
        tab.buttonText.color = tab.textColors.colorActive;

        //int index = tab.transform.GetSiblingIndex();
        //
        // for (int i = 0; i < pages.Count; i++)
        // {
        //     pages[i].SetActive(i == index);
        // }

        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(tab.transform.GetSiblingIndex());
        }
    }
    public void OnTabSelected(TabButton button)
    {
        if (selectedTab != null && selectedTab != button)
        {
            selectedTab.Deselect();
        }

        selectedTab = button;
        selectedTab.Select();

        ResetTabs();
        button.background.sprite = tabActive;

        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(button.transform.GetSiblingIndex());
        }
    }
    /// <summary>
    /// Handles mouse click events.
    /// </summary>
    /// <param name="button">The tab button highlighted</param>

    public void OnTabSelected(TabButton button)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }

        selectedTab = button;

        selectedTab.Select();

        ResetTabs();

        button.UpdateBackground(tabActive);
        button.UpdateText(txtLight);

        if (panelGroup != null)
        {
            panelGroup.SetPageIndex(selectedTab.transform.GetSiblingIndex());
        }
    }
Example #7
0
 public void OnTabSelected(TabButton button)
 {
     if (selectedButton != null)
     {
         selectedButton.Deselect();
     }
     selectedButton = button;
     selectedButton.Select();
     ResetTabs();
     button.background.color = active;
     if (shouldSwapObjects)
     {
         SwapObjects(button);
     }
     else
     {
         if (panelGroup != null)
         {
             panelGroup.SetPageIndex(button.transform.GetSiblingIndex());
         }
     }
 }
 void Start()
 {
     McDetailsPanel.SetPageIndex(0);
 }