예제 #1
0
    public void onTabSelected(SkillButton button)
    {
        if (selectedTab != null)
        {
            selectedTab.Deselect();
        }


        selectedTab = button;

        selectedTab.Select();
        ResetTabs();
        button.background.color = Color.grey;

        skillname.text        = selectedTab.name;
        skillicon.sprite      = selectedTab.buttonSprite.sprite;
        skilldescription.text = selectedTab.GetComponent <Text>().text;
        // selectedTab.unlockable = false;

        // UnlockSkill();
    }
예제 #2
0
    public void OnSkillSelected(SkillButton button)
    {
        if (selectedSkill != null)
        {
            selectedSkill.Deselect();
        }

        selectedSkill = button;
        selectedSkill.Select();
        int index = button.transform.GetSiblingIndex();

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