| | |
| | | using LitJson; |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //天赋 |
| | | public partial class HeroUIManager : GameSystemManager<HeroUIManager> |
| | |
| | | public int[] washByLockUseCounts; |
| | | public int canWashStarLevel; //达到X星可以洗练 |
| | | |
| | | public string selectHeroGuidForGiftFunc; |
| | | public string selectHeroGuidForGiftFunc;//武将主体GUID |
| | | |
| | | public int eatHeroIDForResult; //等待吞噬结果武将ID 为了弹成功界面使用 |
| | | public string selectHeroGuidForGiftFuncForSuccessWin; //等待服务器返回的武将GUID 显示成功界面内容 |
| | | public List<int> heroBeforeGiftIDList = new List<int>(); //会有重复的ID,不要用字典 |
| | | public List<int> heroBeforeGiftLevelList = new List<int>(); |
| | | |
| | | |
| | | public event Action SelectEatHeroEvent; |
| | | string m_SelectEatHeroGuid; //被吞噬武将GUID |
| | | public string selectEatHeroGuid |
| | | { |
| | | get { return m_SelectEatHeroGuid; } |
| | | set |
| | | { |
| | | m_SelectEatHeroGuid = value; |
| | | SelectEatHeroEvent?.Invoke(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public List<string> heroEatList = new List<string>(); |
| | | |
| | | |
| | | void ParseGiftConfig() |
| | | { |
| | |
| | | } |
| | | return HeroQualityConfig.Get(quality).InitStarUpper + addStarCount; |
| | | } |
| | | |
| | | |
| | | public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero) |
| | | |
| | | |
| | | //beforeGiftIDList用于对比变化的天赋格子 |
| | | public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList= null, List<int> beforeGiftLevelList= null) |
| | | { |
| | | int showCount = GetGiftGirdMaxCount(hero.heroId); |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | |
| | | { |
| | | int giftID = hero.talentIDList[i]; |
| | | int giftLV = hero.talentLvList[i]; |
| | | giftBaseCells[i].Init(giftID, giftLV); |
| | | int state = 0; //0:不显示 1:新增 2:提升 |
| | | |
| | | if (!beforeGiftIDList.IsNullOrEmpty()) |
| | | { |
| | | if (i >= beforeGiftIDList.Count) |
| | | { |
| | | state = 1; |
| | | } |
| | | else |
| | | { |
| | | if (giftID != beforeGiftIDList[i]) |
| | | { |
| | | state = 1; |
| | | } |
| | | else |
| | | { |
| | | if (giftLV > beforeGiftLevelList[i]) |
| | | { |
| | | state = 2; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | giftBaseCells[i].Init(giftID, giftLV, null, state); |
| | | } |
| | | else |
| | | { |
| | | if (!beforeGiftIDList.IsNullOrEmpty()) |
| | | { |
| | | //对比情况下不显示 |
| | | giftBaseCells[i].SetActive(false); |
| | | continue; |
| | | } |
| | | |
| | | //非对比的显示 |
| | | if (i < normalGiftMaxCnt) |
| | | { |
| | | giftBaseCells[i].Init(0, 0); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void CacheHeroEatList() |
| | | { |
| | | heroEatList = PackManager.Instance.GetSinglePack(PackType.Hero).GetItemGUIDListById( |
| | | HeroManager.Instance.GetHero(selectHeroGuidForGiftFunc).heroId); |
| | | heroEatList.Remove(selectHeroGuidForGiftFunc); //排除吞噬主体 |
| | | heroEatList.Sort(CmpDeleteHero); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true) |
| | | { |
| | | int imgCount = starImages.Length; |
| | | for (int i = 0; i < imgCount; i++) |
| | | { |
| | | if (starCount == 0 && i == 0) |
| | | { |
| | | if (noStarShow) |
| | | { |
| | | // 无星级 特殊处理 显示一个空星星 |
| | | starImages[i].SetActive(true); |
| | | starImages[i].SetSprite("herostar" + starCount); |
| | | } |
| | | else |
| | | { |
| | | starImages[i].SetActive(false); |
| | | } |
| | | } |
| | | else if ((starCount - 1) % imgCount >= i) |
| | | { |
| | | starImages[i].SetActive(true); |
| | | starImages[i].SetSprite("herostar" + (((starCount - 1) / imgCount) + 1) * imgCount); |
| | | } |
| | | else |
| | | { |
| | | starImages[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |