| | |
| | | |
| | | //showState 0:不显示 1:新增 2:提升 |
| | | //giftID 0 :代表灰色需升星激活 -1:代表棕色需觉醒激活,其他根据配表,没有天赋的外层控制显隐 |
| | | public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0) |
| | | public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0) |
| | | { |
| | | giftBtn.AddListener(onclick); |
| | | if (HeroTalentConfig.HasKey(giftID)) |
| | | { |
| | | var config = HeroTalentConfig.Get(giftID); |
| | |
| | | lvRect.SetActive(false); |
| | | stateImg.SetActive(false); |
| | | } |
| | | giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); }); |
| | | } |
| | | |
| | | void ShowSmallTip(int giftID, int giftLV, int heroID, int index) |
| | | { |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | if (giftID > 0) |
| | | { |
| | | 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))); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | |
| | | } |
| | | else if (giftID == 0) |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift1"); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | } |
| | | else if (giftID == -1) |
| | | { |
| | | SmallTipWin.showText = Language.Get("HeroGift2", HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index)); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Color32 GetColor(int quality) |
| | | { |
| | |
| | | |
| | | } |
| | | scale = width / rect.sizeDelta.x; |
| | | cellContainer.transform.localScale = new Vector3(scale, scale, scale); |
| | | cellContainer.transform.localScale = cellContainer.transform.localScale * scale; |
| | | } |
| | | } |
| | | |