| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class HeroShowLHWin : UIBase |
| | | { |
| | | [SerializeField] UIHeroController roleLHModel; |
| | | [SerializeField] PositionTween roleLHModelTween; |
| | | [SerializeField] UIAlphaTween roleLHModelTween2; |
| | | [SerializeField] RawImage bgTexture; |
| | | [SerializeField] Image qualityImg; |
| | | [SerializeField] HeroCallResultCell showLHResultCell; |
| | | [SerializeField] Image newMarkLHImg; |
| | | [SerializeField] Button showNextlhOrCloseBtn; |
| | | |
| | | [SerializeField] Text heroNameText; |
| | | [SerializeField] Image heroCountryImg; |
| | | [SerializeField] Image heroJobImg; |
| | | [SerializeField] Text jobPosNameText; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | showNextlhOrCloseBtn.AddListener(RefreshLihui); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | RefreshLihui(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | void RefreshLihui() |
| | | { |
| | | //汇总品质传说及以上的立绘 |
| | | int heroID = 0; |
| | | if (ItemLogicUtility.Instance.poplhHeroIdList.Count > 0) |
| | | { |
| | | heroID = ItemLogicUtility.Instance.poplhHeroIdList[0]; |
| | | ItemLogicUtility.Instance.poplhHeroIdList.RemoveAt(0); |
| | | } |
| | | else |
| | | { |
| | | CloseWindow(); |
| | | return; |
| | | } |
| | | var hero = HeroConfig.Get(heroID); |
| | | roleLHModel.Create(hero.SkinIDList[0], 1, motionName: "", isLh: true); |
| | | qualityImg.SetSprite("HeroCallQuality" + hero.Quality); |
| | | newMarkLHImg.SetActive(HeroUIManager.Instance.IsNewHero(heroID)); |
| | | showLHResultCell.Display(heroID, 0, true); |
| | | RefreshHeroInfo(heroID); |
| | | roleLHModelTween.SetStartState(); |
| | | roleLHModelTween.Play(); |
| | | roleLHModelTween2.SetStartState(); |
| | | roleLHModelTween2.Play(); |
| | | bgTexture.SetTexture2D("countryBG" + hero.Country); |
| | | } |
| | | |
| | | void RefreshHeroInfo(int heroID) |
| | | { |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | heroNameText.text = heroConfig.Name; |
| | | heroNameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality); |
| | | heroCountryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | heroJobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | jobPosNameText.text = HeroUIManager.Instance.GetJobName(heroConfig.Class) + " " + heroConfig.Desc; |
| | | } |
| | | } |