Exemple #1
0
    void UpdataSkillAttribute()
    {
        skillAttribute = new BaseAttribute();
        SkillAttribute _skill = null;

        if (dataModel.skillArray == null)
        {
            return;
        }
        for (int i = 0; i < dataModel.skillArray.Length; i++)
        {
            for (int j = 0; j < dataModel.skillArray[i].skillAry.Count; j++)
            {
                _skill = Manage.Instance.Data.GetObj <SkillAttribute>(dataModel.skillArray[i].skillAry[j]);
                if (_skill.triggerType == 1)
                {
                    continue;
                }
                if (_skill.effectType.Length == 0)
                {
                    continue;
                }
                if (_skill.effectType[0] != 6)
                {
                    continue;
                }
                if (_skill.IsNeedEquipment(dataModel) == false)
                {
                    continue;
                }
                _skill.additionalAttribute.Additional(finalAttribute, skillAttribute);
            }
        }
    }
    public void UpdateSkill(SkillAttribute skill, Unit unit)
    {
        type        = 3;
        model       = skill;
        icon.sprite = Manage.Instance.AB.GetGame <Sprite>(AssetbundleEnum.SkillIcon, skill.icon);
        int needAp = skill.GetAP(unit.DataModel.finalAttribute);

        Interactable(unit.CurrentAP >= needAp);
        number.color = unit.CurrentAP >= needAp ? Color.white : Color.red;
        number.text  = needAp.ToString();

        if (skill.IsNeedEquipment(unit.DataModel.dataModel) == false)
        {
            mask.SetActive(true);
            return;
        }
        Open();
    }