Пример #1
0
    private void SetAttribute(AbilityData abilityData)
    {
        int attributeInfoIndex = 0;

        var abilityDataList = abilityData.GetAbilityDataList();

        for (int abilityIndex = 0; abilityIndex < abilityDataList.Count; abilityIndex++)
        {
            if (abilityDataList[abilityIndex] == 0)
            {
                continue;
            }

            var abilityName = AbilityService.GetAbilityNameByIndex(abilityIndex);
            attributeInfoList[attributeInfoIndex].SetAttributeText($"{abilityName} + {abilityDataList[abilityIndex]}");
            attributeInfoList[attributeInfoIndex].OnShow();
            ++attributeInfoIndex;
        }

        for (int i = attributeInfoIndex; i < attributeInfoList.Count; i++)
        {
            attributeInfoList[i].OnHide();
        }
    }