From d15534a0043139541c66a84b404bf15879e31a8b Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 08:51:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Item/DeviceItem.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 51687e3e..c1f33bc8 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -48,7 +48,15 @@ public class DeviceItem : MonoBehaviour bool.TryParse(obj[0], out isActive); if (obj.Length == 1 || (obj.Length > 1 && obj[1] == device.Name)) { - gameObject.GetComponent().enabled = isActive; + var high = gameObject.GetComponent(); + if (high != null) + { + gameObject.GetComponent().enabled = isActive; + } + else + { + Debug.LogError(device.Name + "ûи"); + } } } } From 019ec34980b521c757b1389ca55714e64c3cb081 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 13 Jan 2025 09:11:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/UIModeSelect.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/UI/UIModeSelect.cs b/Assets/Scripts/UI/UIModeSelect.cs index ba40bb78..1c80da8a 100644 --- a/Assets/Scripts/UI/UIModeSelect.cs +++ b/Assets/Scripts/UI/UIModeSelect.cs @@ -12,11 +12,6 @@ namespace QFramework.Example protected override void OnInit(IUIData uiData = null) { mData = uiData as UIModeSelectData ?? new UIModeSelectData(); - // please add init code here - } - - protected override void OnOpen(IUIData uiData = null) - { TechBtn.onClick.AddListener(() => { Hide(); @@ -31,6 +26,11 @@ namespace QFramework.Example }); } + protected override void OnOpen(IUIData uiData = null) + { + + } + protected override void OnShow() {