com.alicizax.unity.ui.exten.../Runtime/UXComponent/Hotkey/UXHotkey.cs
2025-10-13 20:20:01 +08:00

29 lines
647 B
C#

#if INPUTSYSTEM_SUPPORT
using System;
using UnityEngine;
namespace AlicizaX.UI.Extension
{
public class UXHotkey : MonoBehaviour
{
[SerializeField] private UXButton _button;
[SerializeField] internal UnityEngine.InputSystem.InputActionReference _hotKeyRefrence;
[SerializeField] internal EHotkeyPressType _hotkeyPressType;
private void OnValidate()
{
_button = GetComponent<UXButton>();
}
internal void HotkeyActionTrigger()
{
if (_button.Interactable)
{
_button.OnSubmit(null);
}
}
}
}
#endif