| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | //羁绊中的武将 |
| | | public class HeroConnectionHeadCell : MonoBehaviour |
| | |
| | | |
| | | connMarkImg.SetActive(index != 0); |
| | | } |
| | | |
| | | public async UniTask DisplayAsync(int heroID, int index, bool showCollect = false, int _skinID = 0) |
| | | { |
| | | int skinID = 0; |
| | | HeroConfig heroConfig = HeroConfig.Get(heroID); |
| | | if (_skinID != 0) |
| | | { |
| | | skinID = _skinID; |
| | | } |
| | | else |
| | | { |
| | | skinID = heroConfig.SkinIDList[0]; //默认第一个图鉴展示 |
| | | |
| | | } |
| | | |
| | | nameText.text = heroConfig.Name; |
| | | qualityImg.SetSprite("heroheadBG" + heroConfig.Quality); |
| | | var sprite = await UILoader.LoadSpriteAsync("HeroHead", HeroSkinConfig.Get(skinID).SquareIcon); |
| | | if (this == null) return; |
| | | if (sprite == null) |
| | | { |
| | | // 内网未配置时 |
| | | heroIcon.SetSprite("herohead_default"); |
| | | } |
| | | else |
| | | { |
| | | heroIcon.overrideSprite = sprite; |
| | | } |
| | | |
| | | if (showCollect) |
| | | { |
| | | //未获得武将要置灰 |
| | | heroIcon.gray = !HeroManager.Instance.HasHero(heroID); |
| | | |
| | | } |
| | | |
| | | connMarkImg.SetActive(index != 0); |
| | | } |
| | | } |
| | | |