diff --git a/Runtime/UXComponent/UX/UXHotkey.cs b/Runtime/UXComponent/UX/UXHotkey.cs index 7ed6598..28911e8 100644 --- a/Runtime/UXComponent/UX/UXHotkey.cs +++ b/Runtime/UXComponent/UX/UXHotkey.cs @@ -163,12 +163,11 @@ public static class UXButtonHotkeyExtension button._hotkeyPressType ); } - } public static void UnBindHotKey(this UXButton button) { - if (button == null) return; + if (button == null || button._hotKeyRefrence == null) return; UXHotkeyComponent.UnregisterHotkey(button); } }