46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
|
|
#if INPUTSYSTEM_SUPPORT
|
||
|
|
using AlicizaX.Editor;
|
||
|
|
using AlicizaX.UI.Extension;
|
||
|
|
using UnityEditor;
|
||
|
|
|
||
|
|
namespace UnityEngine.UI.Hotkey
|
||
|
|
{
|
||
|
|
[CustomEditor(typeof(UXHotkey))]
|
||
|
|
public class HotkeyInspector : GameFrameworkInspector
|
||
|
|
{
|
||
|
|
private UXHotkey _target;
|
||
|
|
private SerializedProperty _button;
|
||
|
|
private SerializedProperty _hotKeyRefrence;
|
||
|
|
private SerializedProperty _hotkeyPressType;
|
||
|
|
|
||
|
|
private void OnEnable()
|
||
|
|
{
|
||
|
|
_target = (UXHotkey)target;
|
||
|
|
_button = serializedObject.FindProperty("_button");
|
||
|
|
_hotKeyRefrence = serializedObject.FindProperty("_hotKeyRefrence");
|
||
|
|
_hotkeyPressType = serializedObject.FindProperty("_hotkeyPressType");
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void OnInspectorGUI()
|
||
|
|
{
|
||
|
|
serializedObject.Update();
|
||
|
|
|
||
|
|
var holder = _target.GetComponent<UXButton>();
|
||
|
|
if (holder == null)
|
||
|
|
{
|
||
|
|
EditorGUILayout.HelpBox(
|
||
|
|
"⚠ 当前对象缺少 UXButton 组件",
|
||
|
|
MessageType.Error
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
EditorGUILayout.PropertyField(_button);
|
||
|
|
EditorGUILayout.PropertyField(_hotKeyRefrence);
|
||
|
|
EditorGUILayout.PropertyField(_hotkeyPressType);
|
||
|
|
serializedObject.ApplyModifiedProperties();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif
|