diff --git a/Runtime/UXComponent/UX/UXHotkey.cs b/Runtime/UXComponent/UX/UXHotkey.cs index 94d0238..443e1a7 100644 --- a/Runtime/UXComponent/UX/UXHotkey.cs +++ b/Runtime/UXComponent/UX/UXHotkey.cs @@ -115,6 +115,8 @@ internal static class UXHotkeyComponent if (registrations[i].button == button) { hotkeyInfo = registrations[i]; + registrations.RemoveAt(i); + _hotkeyRegistry.Remove(actionId); if (_sharedHandlers.TryGetValue(actionId, out var handlerInfo)) { var (handler, pressType) = handlerInfo; @@ -141,8 +143,6 @@ internal static class UXHotkeyComponent _sharedHandlers.Remove(actionId); } - registrations.RemoveAt(i); - _hotkeyRegistry.Remove(actionId); break; } }