From 67a1efcab08e7e6815b64ed2a8710da9b836ff8c Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 8 May 2025 10:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=8F=8D=E9=A6=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UIImageSelectMap.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/UI/UIImageSelectMap.cs b/Assets/Scripts/UI/UIImageSelectMap.cs index 2bddaf07..aea655b3 100644 --- a/Assets/Scripts/UI/UIImageSelectMap.cs +++ b/Assets/Scripts/UI/UIImageSelectMap.cs @@ -72,6 +72,9 @@ namespace QFramework.Example foreach (var item in row.items) { var rightObj = GameObject.Instantiate(RightItem, itemContent); + var nameText = rightObj.transform.Find("Name").GetComponent(); + nameText.text = item.name; + nameText.color = Color.white; rightObj.name = item.pic; rightObj.transform.Find("PicBg/Pic").GetComponent().color = new Color(1, 1, 1, 0); rightObj.OnPointerEnterEvent(RightOnEnter); @@ -121,7 +124,7 @@ namespace QFramework.Example trans.GetComponent().color = Color.white; trans.Find("PicBg/Pic").GetComponent().color = new Color(1, 1, 1, 0); - enterRight.transform.Find("Name").GetComponent().text = string.Empty; + enterRight.transform.Find("Name").GetComponent().color = Color.white; leftAndRightMap.Remove(trans.gameObject); } @@ -170,7 +173,7 @@ namespace QFramework.Example Image img = enterRight.transform.Find("PicBg/Pic").GetComponent(); img.sprite = moveObj.GetComponent().sprite; img.color = Color.white; - nameText.text = itemDatas[leftDragObj].name; + //nameText.text = itemDatas[leftDragObj].name; leftAndRightMap.Add(enterRight, new RightDataItem() { rightObj = leftDragObj, isRight = isRight }); leftDragObj.SetActive(false);