From 8a0a2b1a00807ac7a51bad0aafc231c996fc232f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Mon, 22 Dec 2025 10:50:18 +0800 Subject: [PATCH] 1 --- Runtime/UXComponent/Hotkey/HotkeyBindComponent.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Runtime/UXComponent/Hotkey/HotkeyBindComponent.cs b/Runtime/UXComponent/Hotkey/HotkeyBindComponent.cs index 4263535..96be405 100644 --- a/Runtime/UXComponent/Hotkey/HotkeyBindComponent.cs +++ b/Runtime/UXComponent/Hotkey/HotkeyBindComponent.cs @@ -44,17 +44,14 @@ namespace UnityEngine.UI [ContextMenu("Bind HotKeys")] private void CollectUXHotkeys() { - // 更稳健的查找:先拿所有 MonoBehaviour,再 OfType 接口 var found = gameObject .GetComponentsInChildren(true) .OfType() - .Where(t => t.HotkeyAction != null) // 保留原来的筛选条件(如果 HotkeyAction 存在) + .Where(t => t.HotkeyAction != null) .Select(t => t as Component) .ToArray(); hotButtons = found; - - Debug.Log($"[HotkeyBindComponent] 已找到 {hotButtons.Length} 个 UXHotkey 组件并绑定。"); } private void OnValidate()