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()