| | |
| | | } |
| | | } |
| | | |
| | | Image m_AwakeLockImg; //重生降低觉醒等级锁定的图片 |
| | | Image awakeLockImg |
| | | { |
| | | get |
| | | { |
| | | if (m_AwakeLockImg == null) |
| | | { |
| | | m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock"); |
| | | } |
| | | return m_AwakeLockImg; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void Awake() |
| | |
| | | |
| | | //showState 0:不显示 1:新增 2:提升 |
| | | //giftID 0 :代表灰色需升星激活 -1:代表棕色需觉醒激活,其他根据配表,没有天赋的外层控制显隐 |
| | | public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0) |
| | | public void Init(int giftID, int lv, int showState = 0, int heroID = 0, int index = 0, int awakeLevel = 0) |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (HeroTalentConfig.HasKey(giftID)) |
| | | { |
| | | var config = HeroTalentConfig.Get(giftID); |
| | |
| | | stateImg.SetActive(showState > 0); |
| | | stateImg.SetSprite("GiftState" + showState); |
| | | stateImg.SetNativeSize(); |
| | | |
| | | //特殊处理重生降低觉醒等级锁定的天赋 |
| | | if (index >= HeroUIManager.Instance.normalGiftMaxCnt) |
| | | { |
| | | awakeLockImg.SetActive(HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index) > awakeLevel); |
| | | } |
| | | else |
| | | { |
| | | awakeLockImg.SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | giftName.text = string.Empty; |
| | | lvRect.SetActive(false); |
| | | stateImg.SetActive(false); |
| | | awakeLockImg.SetActive(false); |
| | | } |
| | | giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); }); |
| | | giftBtn.AddListener(() => { ShowSmallTip(giftID, lv, heroID, index, awakeLevel); }); |
| | | } |
| | | |
| | | void ShowSmallTip(int giftID, int giftLV, int heroID, int index) |
| | | void ShowSmallTip(int giftID, int giftLV, int heroID, int index, int awakeLevel) |
| | | { |
| | | 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))); |
| | | Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue*giftLV))); |
| | | |
| | | if (index >= HeroUIManager.Instance.normalGiftMaxCnt) |
| | | { |
| | | int needAwakeLV = HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index); |
| | | if (needAwakeLV > awakeLevel) |
| | | { |
| | | SmallTipWin.showText += "\n" + Language.Get("HeroAwake18", needAwakeLV); |
| | | } |
| | | } |
| | | |
| | | |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | |
| | | } |
| | |
| | | { |
| | | if (quality == 1) |
| | | { |
| | | //1D0029 |
| | | return new Color32(29, 0, 41, 128); |
| | | //692088 |
| | | return new Color32(105, 32, 136, 128); |
| | | } |
| | | else if (quality == 2) |
| | | { |
| | | //372300 |
| | | return new Color32(55, 35, 0, 128); |
| | | //886220 |
| | | return new Color32(136, 98, 32, 128); |
| | | } |
| | | else if (quality == 3) |
| | | { |
| | | //3A1800 |
| | | return new Color32(58, 24, 0, 128); |
| | | //884a20 |
| | | return new Color32(136, 74, 32, 128); |
| | | } |
| | | else if (quality == 4) |
| | | { |
| | | //3A0000 |
| | | return new Color32(58, 0, 0, 128); |
| | | //882020 |
| | | return new Color32(136, 32, 32, 128); |
| | | } |
| | | return new Color32(0, 0, 0, 128); |
| | | } |