com.alicizax.unity.ui.exten.../Runtime/UXComponent/Hotkey/UXHotkeyButton.cs

29 lines
608 B
C#
Raw Normal View History

2025-12-09 20:30:11 +08:00
#if INPUTSYSTEM_SUPPORT
2025-08-08 16:25:09 +08:00
using UnityEngine;
2025-12-09 20:30:11 +08:00
using UnityEngine.InputSystem;
2025-08-08 16:25:09 +08:00
2025-12-09 20:30:11 +08:00
namespace AlicizaX.UI
2025-08-08 16:25:09 +08:00
{
2025-10-22 15:24:47 +08:00
[DisallowMultipleComponent]
public class UXHotkeyButton : UXButton
2025-08-08 16:25:09 +08:00
{
2025-12-09 20:30:11 +08:00
[SerializeField] internal InputActionReference _hotKeyRefrence;
2025-10-13 20:20:01 +08:00
[SerializeField] internal EHotkeyPressType _hotkeyPressType;
2025-08-08 16:25:09 +08:00
2025-12-16 15:36:13 +08:00
public InputActionReference HotKeyRefrence
{
get { return _hotKeyRefrence; }
}
2025-10-13 20:20:01 +08:00
internal void HotkeyActionTrigger()
2025-08-08 16:25:09 +08:00
{
if (Interactable)
2025-08-08 16:25:09 +08:00
{
OnSubmit(null);
2025-08-08 16:25:09 +08:00
}
}
}
}
2025-12-09 20:30:11 +08:00
#endif