From fe421e1b91bbb3f69e494ec58dd8092d61346f5e Mon Sep 17 00:00:00 2001 From: yyl <yyl> Date: 星期五, 05 九月 2025 15:25:31 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts --- Main/System/HeroUI/GiftBaseCell.cs | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs index efa2179..8370f3e 100644 --- a/Main/System/HeroUI/GiftBaseCell.cs +++ b/Main/System/HeroUI/GiftBaseCell.cs @@ -106,9 +106,8 @@ //showState 0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗� //giftID 0 :浠h〃鐏拌壊闇�鍗囨槦婵�娲� -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); @@ -129,7 +128,32 @@ 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) { @@ -220,7 +244,7 @@ } scale = width / rect.sizeDelta.x; - cellContainer.transform.localScale = new Vector3(scale, scale, scale); + cellContainer.transform.localScale = cellContainer.transform.localScale * scale; } } -- Gitblit v1.8.0