| | |
| | | [SerializeField] GiftBaseCell[] giftBaseCells; |
| | | [SerializeField] Button totalGiftBtn; |
| | | [SerializeField] Button starUPBtn; |
| | | [SerializeField] Text starUPBtnText; |
| | | [SerializeField] Button washBtn; |
| | | |
| | | |
| | |
| | | }); |
| | | lvupBtn.AddListener(LVUp); |
| | | lvupBtn.onPress.AddListener(LVUp); |
| | | |
| | | totalGiftBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroGiftWin>(); |
| | | }); |
| | | |
| | | starUPBtn.AddListener(StarUP); |
| | | } |
| | | |
| | | |
| | |
| | | addPerObject.SetActive(true); |
| | | for (int i = 0; i < addPerText.Length; i++) |
| | | { |
| | | addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer); |
| | | addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.LVAddPer); |
| | | } |
| | | addPerObject.Play(() => |
| | | { |
| | |
| | | |
| | | void RefreshGift() |
| | | { |
| | | RefreshGiftCell(); |
| | | |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | { |
| | | starUPBtn.interactable = false; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift7"); |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | } |
| | | |
| | | void RefreshGiftCell() |
| | | { |
| | | //传说以下只有4个 |
| | | int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt; |
| | | for (int i = 0; i < giftBaseCells.Length; i++) |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | void StarUP() |
| | | { |
| | | if (hero.GetTotalStarCount() >= hero.GetMaxStarCount()) |
| | | { |
| | | return; |
| | | } |
| | | else if (hero.IsFullStar()) |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, false); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | else |
| | | { |
| | | starUPBtn.interactable = true; |
| | | starUPBtn.SetColorful(null, true); |
| | | starUPBtnText.text = Language.Get("HeroGift3"); |
| | | } |
| | | } |
| | | } |