From c42747c233467b9aa54928e9bc385fb81a90b38d Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Mon, 25 Nov 2024 17:58:45 +0800 Subject: [PATCH] =?UTF-8?q?UI=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Script/Scheduled_03/Panel.cs | 24 ++++---------------- xiaofang/Assets/Script/Scheduled_03/Tags.cs | 2 ++ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index ef580e55..de51fbc1 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -40,20 +40,6 @@ public class Panel : MonoBehaviour GetData(); } - public void SetName() - { - - } - - public void SetDuty() - { - - } - - public void SetScene() - { - - } //处理点击选择剧本按钮 @@ -100,7 +86,7 @@ public class Panel : MonoBehaviour - + //获取鼠标点击位置的信息 public void GetData() { // 当鼠标左键按下时进行检测 @@ -115,7 +101,7 @@ public class Panel : MonoBehaviour // 创建 PointerEventData 来记录点击事件的数据 PointerEventData pointerData = new PointerEventData(eventSystem); - pointerData.position = Input.mousePosition; + pointerData.position = Input.mousePosition;//获取鼠标点击的位置 // 用于存储射线检测的结果 List results = new List(); @@ -132,17 +118,17 @@ public class Panel : MonoBehaviour if (clickedButton != null) { Text buttonText = clickedButton.GetComponentInChildren(); - if (buttonText != null && buttonText.tag == Tags.people) + if (buttonText != null && buttonText.tag == Tags.people)//这里可以获取标签为人员的信息 { name = buttonText.text; Debug.Log(name); } - else if (buttonText != null && buttonText.tag == Tags.scene) + else if (buttonText != null && buttonText.tag == Tags.scene)//这里可以获取标签为场景的信息 { scene = buttonText.text; Debug.Log(scene); } - else if (buttonText != null && buttonText.tag == Tags.duty) + else if (buttonText != null && buttonText.tag == Tags.duty)//这里可以获取标签为职责的信息 { duty = buttonText.text; Debug.Log(duty); diff --git a/xiaofang/Assets/Script/Scheduled_03/Tags.cs b/xiaofang/Assets/Script/Scheduled_03/Tags.cs index eee90674..bbe39081 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Tags.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Tags.cs @@ -8,3 +8,5 @@ public class Tags public const string duty = "Duty"; public const string scene = "Scene"; } + +