示例#1
0
    public void ShowSkillMenu()
    {
        targetMenu.SetActive(false);
        skillMenu.SetActive(true);
        baseMenu.SetActive(false);
        currentMenu = MenuState.Skills;

        for (int i = 0; i < skillMenu.transform.childCount - 1; i++)
        {
            if (i >= actor.skills.Count)
            {
                targetMenu.transform.GetChild(i).gameObject.SetActive(false);
            }
            else
            {
                targetMenu.transform.GetChild(i).gameObject.SetActive(true);

                Action a = actor.skills[i];

                ActionButton button = targetMenu.transform.GetChild(i).GetComponent <ActionButton>();
                button.GetComponentInChildren <Text>().text = a.name;
                button.SetAction(a);
            }
        }
    }
示例#2
0
    public ActionButton GetButton()
    {
        ActionButton ActButton = Instantiate(Button);

        if (icon != null)
        {
            ActButton.GetComponent <Image>().sprite        = icon;
            ActButton.GetComponentInChildren <Text>().text = "";
        }
        else
        {
            ActButton.GetComponentInChildren <Text>().text = this.Name;
        }
        ActButton.SetActionToDo(this);

        return(ActButton);
    }