Beispiel #1
0
    public override void OnRefreshWindow()
    {
        // 原来的属性
        _imgHeroIcon.sprite = ResourceManager.Instance.GetHeroIcon(_oriInfo.ConfigID);
        _imgHeroBg.sprite   = ResourceManager.Instance.GetIconBgByQuality(_oriInfo.StarLevel);
        _starPanel.SetStar(_oriInfo.StarLevel);
        _texHeroFirstForce.text  = _oriInfo.Property.Strength.ToString();
        _texHeroFirstLeader.text = _oriInfo.Property.Leadership.ToString();
        _texHeroFirstChi.text    = _oriInfo.Property.Intelligence.ToString();
        _txtName.text            = string.Format("{0} Lv.{1}", _oriInfo.Cfg.HeroName, _oriInfo.Level);
        _txtName.color           = ResourceManager.Instance.GetColorByQuality(_oriInfo.StarLevel);

        // 新的属性
        _newStarPanel.SetStar(_info.StarLevel);
        _imgNewHeroIcon.sprite = _imgHeroIcon.sprite;
        _imgNewHeroBg.sprite   = _imgHeroBg.sprite;
        _texHeroEndForce.text  = _info.Property.Strength.ToString();
        _texHeroEndLeader.text = _info.Property.Leadership.ToString();
        _texHeroEndchi.text    = _info.Property.Intelligence.ToString();
        _txtNewName.text       = string.Format("{0} Lv.{1}", _info.Cfg.HeroName, _info.Level);
        _txtNewName.color      = ResourceManager.Instance.GetColorByQuality(_info.StarLevel);

        if (_info.StarLevel == 2)
        {
            _textHeroSkillTag.text = Str.Get("UI_HERO_TALENTSKILL_OPEN");
        }
        else
        {
            _textHeroSkillTag.text = Str.Get("UI_HERO_TALENTSKILL_CLOSE");
        }
        _texHeroSkillInfo.text  = _info.GetTalentSkillInfo();
        _textHeroSkillName.text = _info.GetFixedSkillName(_info.Cfg.PassiveSkill, _info.StarLevel - 1);
    }
Beispiel #2
0
    public void SetHeroInfo(HeroInfo info)
    {
        if (info == null)
        {
            return;
        }

        bool anim = _currentInfo == null || _currentInfo.ConfigID != info.ConfigID;

        _currentInfo = info;

        List <float> propList = new List <float> {
            info.Cfg.ViabilityPower, info.Cfg.AuxiliaryPower, info.Cfg.PhysicalDamage, info.Cfg.ComprehensiveAbility, info.Cfg.AbilityDamage
        };

        _heroProp.SetPropList(propList, anim);

        // 英雄属性
        _txtStr.text         = info.Property.Strength.ToString();
        _txtLeadership.text  = info.Property.Leadership.ToString();
        _txtInt.text         = info.Property.Intelligence.ToString();
        _txtAttack.text      = info.Property.Attack.ToString();
        _txtMagicAttack.text = info.Property.MagicAttack.ToString();
        _txtHp.text          = info.Property.Hp.ToString();
        _txtCritical.text    = info.Property.Critical + "%";
        _txtHpSorb.text      = info.Property.HpSorb + "%";
        _txtDef.text         = info.Property.Def + "%";
        _txtStum.text        = info.Property.Stum + "%";
        _txtCooldown.text    = info.Property.Cooldown + "%";
        _txtAttackSpeed.text = info.Property.AttackSpeed + "%";

        for (int i = 0; i < _txtTag.Length; ++i)
        {
            List <int> label = info.Cfg.HeroLabel;
            if (i < label.Count)
            {
                _txtTag[i].gameObject.SetActive(true);
                _txtTag[i].text = Str.Get("UI_HERO_LABEL_" + label[i]);
            }
            else
            {
                _txtTag[i].gameObject.SetActive(false);
            }
        }

        if (_currentInfo.StarLevel > 1)
        {
            _txtTalentSkillName.gameObject.SetActive(true);
            _txtTalentSkillInfo.gameObject.SetActive(true);
            _txtTalentSkillName.text = _currentInfo.GetFixedSkillName(_currentInfo.Cfg.PassiveSkill, _currentInfo.StarLevel - 1);
            _txtTalentSkillInfo.text = _currentInfo.GetTalentSkillInfo();
        }
        else
        {
            _txtTalentSkillName.gameObject.SetActive(false);
            _txtTalentSkillInfo.gameObject.SetActive(false);
        }
    }