| | |
| | | using UnityEngine; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | public class HeroCollectionCardCell : MonoBehaviour |
| | | { |
| | |
| | | // [SerializeField] Button bookLVBtn; |
| | | [SerializeField] GameObject unGetObj; |
| | | [SerializeField] GameObject activeObj; // 可激活带流光效果材质 |
| | | |
| | | [SerializeField] GameObject actLimitObj; // 活动限定 |
| | | public void Display(int index, int quality) |
| | | { |
| | | var heroID = HeroUIManager.Instance.heroCollectDict[quality][index]; |
| | |
| | | activeObj.SetActive(funcState == 1); |
| | | // bookLVBtn.SetActive(funcState > 1); |
| | | unGetObj.SetActive(funcState == 0); |
| | | actLimitObj.SetActive(heroConfig.IsActLimit == 1); |
| | | |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | |
| | | { |
| | | trainStateImg.SetActive(false); |
| | | } |
| | | nameText.text = colData.BookBreakLV == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, colData.BookBreakLV); |
| | | nameText.text = heroConfig.Name; |
| | | |
| | | for (int i = 0; i < starImgList.Count; i++) |
| | | { |
| | | if (colData.BookStarLV == 0 && i == 0) |
| | | { |
| | | // 无星级 特殊处理 |
| | | starImgList[i].SetActive(true); |
| | | starImgList[i].SetSprite("herostar" + colData.BookStarLV); |
| | | } |
| | | else if ((colData.BookStarLV - 1) % starImgList.Count >= i) |
| | | { |
| | | starImgList[i].SetActive(true); |
| | | starImgList[i].SetSprite("herostar" + (((colData.BookStarLV - 1) / starImgList.Count) + 1) * starImgList.Count); |
| | | } |
| | | else |
| | | { |
| | | starImgList[i].SetActive(false); |
| | | } |
| | | starImgList[i].SetActive(false); |
| | | } |
| | | |
| | | heroCardBtn.AddListener(() => |
| | |
| | | var state = HeroUIManager.Instance.GetHeroBookState(heroID, quality); |
| | | if (state == 1 || state == 3 || state == 4) |
| | | { |
| | | UIManager.Instance.OpenWindowAsync<HeroCollectionLvUpWin>().Forget(); |
| | | UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>(); |
| | | } |
| | | else |
| | | { |
| | | HeroUIManager.Instance.selectForPreviewHeroID = heroID; |
| | | UIManager.Instance.OpenWindowAsync<HeroBestWin>().Forget(); |
| | | UIManager.Instance.OpenWindow<HeroBestBaseWin>(); |
| | | } |
| | | }); |
| | | |
| | | // bookLVBtn.AddListener(() => |
| | | // { |
| | | // HeroUIManager.Instance.selectCollectHeroID = heroID; |
| | | // UIManager.Instance.OpenWindowAsync<HeroCollectionLvUpWin>().Forget(); |
| | | // UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>(); |
| | | // }); |
| | | } |
| | | } |