public void SetInfo(HeroInfo heroInfo, ItemInfo itemInfo) { _heroInfo = heroInfo; _itemInfo = itemInfo; _starPanel.SetStar(heroInfo.StarLevel); _imgIconBg.sprite = ResourceManager.Instance.GetHeroBgByStar(heroInfo.StarLevel); _imgIcon.sprite = ResourceManager.Instance.GetHeroImage(heroInfo.ConfigID); _txtHeroName.text = heroInfo.GetName(); _txtHeroName.color = ResourceManager.Instance.GetColorByQuality(heroInfo.StarLevel); _txtFightScore.text = heroInfo.FightingScore.ToString(); _imgItemType.sprite = ResourceManager.Instance.GetItemTypeIcon((ItemType)itemInfo.Cfg.Type); ItemInfo curItemInfo = heroInfo.GetItemByType((ItemType)itemInfo.Cfg.Type); if (curItemInfo != null) { _itemWidget.SetInfo(curItemInfo); _itemWidget.gameObject.SetActive(true); } else { _itemWidget.gameObject.SetActive(false); } }
public void SetHeroInfo(HeroInfo info) { _currentInfo = info; _starPanel.SetStar(info.StarLevel); _imageHeroIconBg.sprite = ResourceManager.Instance.GetHeroIconBgByStar(info.StarLevel); _imageHeroIcon.sprite = ResourceManager.Instance.GetHeroIcon(info.ConfigID); _heroName.text = info.GetName(); _txtHeroLevel.text = "Lv" + info.Level; IsSelect = UserManager.Instance.IsHeroInPVEFormation(info.ConfigID); _imgCheck.gameObject.SetActive(IsSelect); _imageHeroAttribute.sprite = ResourceManager.Instance.GetHeroTypeIcon(info.ConfigID); _heroName.color = ResourceManager.Instance.GetColorByQuality(info.StarLevel); HeroLevelConfig expCfg = HeroLevelConfigLoader.GetConfig(_currentInfo.Level); if (expCfg != null) { if (expCfg.ExpRequire == 0) { _imgExpPrg.fillAmount = 1; _txtExpPrg.gameObject.SetActive(false); } else { _imgExpPrg.fillAmount = 1.0f * _currentInfo.Exp / expCfg.ExpRequire; _txtExpPrg.text = string.Format("{0}/{1}", _currentInfo.Exp, expCfg.ExpRequire); _txtExpPrg.gameObject.SetActive(true); } } _txtFightScore.text = _currentInfo.FightingScore.ToString(); }
public void SetHeroInfo(HeroInfo info, bool fullRefresh = true) { if (info == null) { return; } SetCurrentHeroIndex(info); _currentInfo = info; _txtHeroNameQuality.text = info.GetName(); _txtHeroNameQuality.color = ResourceManager.Instance.GetColorByQuality(_currentInfo.StarLevel); _txtHeroName.text = info.Cfg.HeroName; _txtHeroForce.text = info.FightingScore.ToString(); _imageHeroAttribute.sprite = _sprType[info.Cfg.AttackType - 1]; _imageHeroHeadIcon.sprite = ResourceManager.Instance.GetHeroIcon(info.ConfigID); _imageHeroHeadIconBg.sprite = ResourceManager.Instance.GetHeroIconBgByStar(info.StarLevel); RefreshHeroAttr(); _starPanel.SetStar(_currentInfo.StarLevel); if (_heroDetail != null) { _heroDetail.SetHeroInfo(_currentInfo); } if (_heroAdvance != null) { _heroAdvance.SetHeroInfo(_currentInfo); } if (_heroStarUp != null) { _heroStarUp.SetHeroInfo(_currentInfo); } if (_heroExpBook != null) { _heroExpBook.SetInfo(_currentInfo); } if (_heroSkill != null) { _heroSkill.SetHeroInfo(_currentInfo); } ShowModel(_currentInfo.Cfg.HeroModel); UpdateButton(); }