示例#1
0
    public void GenerateAbilityList(Actor actor, List <IUseable> skills)
    {
        this.gameObject.SetActive(true);

        foreach (IUseable skill in skills)
        {
            SkillButton temp = GameObject.Instantiate <SkillButton>(abilityButton, contentTransform.contentTransform);
            temp.InitButton(skill, tooltippanel);
            temp.ChangeText(skill.GetName());
            temp.button.onClick.AddListener(delegate { SkillClicked(skill, actor); });
            contentTransform.AddToList(temp);

            temp.button.interactable = (skill.CanPayCost(actor) &&
                                        actor.actorData.cooldownMap.IsSKillOnCooldown(skill.GetKey()) == false);
        }

        maxIndex = skills.Count - 1;

        if (maxIndex > 0)
        {
            AdjustMenu(0);
        }
    }