private void PresentActiveSkill(ProgrammerAbility ability)
    {
        RemoveExistingSkillCell();

        foreach (var activeSkill in ability.AcquiredActiveSkills.Where(skill => skill.Information.Type != SkillType.None)
                 .OrderBy(skill => skill.Information.Name))
        {
            var createdCell = Instantiate(skillCellTemplate, skillCellPanelTransform);

            var skillImage = createdCell.GetComponentInChildren <Image>();
            skillImage.sprite = ResourceLoadUtility.LoadIcon(activeSkill.Information.IconName);

            var skillText = createdCell.GetComponentInChildren <Text>();

            int allMaximumLevel = activeSkill.FlattenContainingPassiveSkills()
                                  .Aggregate(activeSkill.Information.MaximumLevel, (totalMaximumLevel, passiveSkill) => totalMaximumLevel + passiveSkill.Information.MaximumLevel);
            int allAcquiredLevel = activeSkill.FlattenContainingPassiveSkills()
                                   .Aggregate(activeSkill.Information.AcquisitionLevel, (totalAcquiredLevel, passiveSkill) => totalAcquiredLevel + passiveSkill.Information.AcquisitionLevel);

            skillText.text = string.Format("{0} ({1} / {2})", activeSkill.Information.Name, allAcquiredLevel, allMaximumLevel);

            var upgradeButton = createdCell.GetComponentInChildren <Button>();
            upgradeButton.onClick.AddListener(() =>
            {
                onUpgradeClicked.Invoke();
                skillManagementPresenter.Present(activeSkill);
            });
        }
    }
示例#2
0
    private void Awake()
    {
        Status = new ProgrammerStatus
        {
            PortraitName = "UnityChan",
            FullHealth   = 50,
            Health       = 50,
            Name         = "테스트 보스"
        };

        Ability = new ProgrammerAbility();

        OnMovingStarted += Rotate;
    }