| | |
| | | using UnityEngine.UI; |
| | | using UnityEngine.Events; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | public class HeroHeadBaseNoTrainCell : MonoBehaviour |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | public async UniTask InitAsync(int heroID, bool _gray = false, UnityAction onclick = null) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | clickBtn.AddListener(onclick); |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | qualityBG.SetSprite("heroheadBG" + heroConfig.Quality); |
| | | |
| | | var sprite = await UILoader.LoadSpriteAsync("HeroHead", HeroSkinConfig.Get(heroConfig.SkinIDList[0]).SquareIcon); |
| | | if (this == null) return; |
| | | heroIcon.overrideSprite = sprite; |
| | | heroIcon.gray = _gray; |
| | | qualityBG.gray = _gray; |
| | | |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | nameText.text = heroConfig.Name; |
| | | |
| | | |
| | | } |
| | | |
| | | GameObject cellContainer; |
| | | protected void LoadPrefab() |
| | | { |