| | |
| | | }); |
| | | |
| | | starUPBtn.AddListener(StarUP); |
| | | washBtn.AddListener(Wash); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | void RefreshGift() |
| | | { |
| | | RefreshGiftCell(); |
| | | HeroUIManager.Instance.RefreshGiftCell(giftBaseCells, hero); |
| | | |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality)) |
| | | { |
| | | starUPBtn.interactable = false; |
| | | starUPBtn.SetColorful(null, false); |
| | |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | } |
| | | |
| | | void RefreshGiftCell() |
| | | if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel) |
| | | { |
| | | //传说以下只有4个 |
| | | int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt; |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | | { |
| | | if (i >= showCount) |
| | | { |
| | | giftBaseCells[i].SetActive(false); |
| | | continue; |
| | | } |
| | | |
| | | giftBaseCells[i].SetActive(true); |
| | | if (i < hero.talentIDList.Count) |
| | | { |
| | | int giftID = hero.talentIDList[i]; |
| | | int giftLV = hero.talentLvList[i]; |
| | | giftBaseCells[i].Init(giftID, giftLV, () => |
| | | { |
| | | var giftConfig = HeroTalentConfig.Get(giftID); |
| | | SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV), |
| | | Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue))); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), false); |
| | | } |
| | | else |
| | | { |
| | | if (i < HeroUIManager.normalGiftMaxCnt) |
| | | { |
| | | giftBaseCells[i].Init(0, 0, () => |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift1"); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | int index = i; |
| | | giftBaseCells[i].Init(-1, 0, () => |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift2", HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(hero.heroId, index)); |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), true); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | void StarUP() |
| | | { |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | HeroUIManager.Instance.selectHeroGuidForGiftFunc = hero.itemHero.guid; |
| | | UIManager.Instance.OpenWindow<HeroGiftEatWin>(); |
| | | } |
| | | } |
| | | |
| | | void Wash() |
| | | { |
| | | if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel); |
| | | return; |
| | | } |
| | | // //根据锁状态判断材料是否足够 |
| | | // if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID, |
| | | // HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2)) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | |
| | | // UIManager.Instance.OpenWindow<HeroGiftWashWin>(); |
| | | |
| | | } |
| | | } |