11
This commit is contained in:
parent
0a3fd47070
commit
a894e5d830
@ -18,11 +18,11 @@ public sealed class InputGlyphDatabaseEditor : Editor
|
|||||||
private const float PreviewSize = 52f;
|
private const float PreviewSize = 52f;
|
||||||
private const float ListPreviewSize = 56f;
|
private const float ListPreviewSize = 56f;
|
||||||
private const int MaxValidationIssuesToShow = 10;
|
private const int MaxValidationIssuesToShow = 10;
|
||||||
private const int DefaultEntriesPerPage = 50;
|
private const int DefaultEntriesPerPage = 10;
|
||||||
|
|
||||||
private static readonly string[] DefaultTableNames = { "Keyboard", "Xbox", "PlayStation", "Other" };
|
private static readonly string[] DefaultTableNames = { "Keyboard", "Xbox", "PlayStation", "Other" };
|
||||||
private static readonly int[] EntriesPerPageOptions = { 25, 50, 100, 200 };
|
private static readonly int[] EntriesPerPageOptions = { 10, 15, 20, 25 };
|
||||||
private static readonly string[] EntriesPerPageLabels = { "25 / 页", "50 / 页", "100 / 页", "200 / 页" };
|
private static readonly string[] EntriesPerPageLabels = { "10 / 页", "15 / 页", "20 / 页", "25 / 页" };
|
||||||
|
|
||||||
private sealed class TableEditorState
|
private sealed class TableEditorState
|
||||||
{
|
{
|
||||||
|
|||||||
@ -114,10 +114,10 @@ public static class InputDeviceWatcher
|
|||||||
|
|
||||||
_anyInputAction = new InputAction("AnyDevice", InputActionType.PassThrough);
|
_anyInputAction = new InputAction("AnyDevice", InputActionType.PassThrough);
|
||||||
_anyInputAction.AddBinding("<Keyboard>/anyKey");
|
_anyInputAction.AddBinding("<Keyboard>/anyKey");
|
||||||
_anyInputAction.AddBinding("<Mouse>/leftButton");
|
// _anyInputAction.AddBinding("<Mouse>/leftButton");
|
||||||
_anyInputAction.AddBinding("<Mouse>/rightButton");
|
// _anyInputAction.AddBinding("<Mouse>/rightButton");
|
||||||
_anyInputAction.AddBinding("<Mouse>/middleButton");
|
// _anyInputAction.AddBinding("<Mouse>/middleButton");
|
||||||
_anyInputAction.AddBinding("<Mouse>/scroll");
|
// _anyInputAction.AddBinding("<Mouse>/scroll");
|
||||||
_anyInputAction.AddBinding("<Gamepad>/*");
|
_anyInputAction.AddBinding("<Gamepad>/*");
|
||||||
_anyInputAction.AddBinding("<Joystick>/*");
|
_anyInputAction.AddBinding("<Joystick>/*");
|
||||||
_anyInputAction.performed += OnAnyInputPerformed;
|
_anyInputAction.performed += OnAnyInputPerformed;
|
||||||
|
|||||||
@ -3,9 +3,9 @@ using UnityEngine.InputSystem;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
[RequireComponent(typeof(UXButton))]
|
[RequireComponent(typeof(UXButton))]
|
||||||
public sealed class InputGlyphUXButton : InputGlyphBehaviourBase
|
public sealed class InputGlyphIHotkeyTrigger : InputGlyphBehaviourBase
|
||||||
{
|
{
|
||||||
[SerializeField] private UXButton button;
|
[SerializeField] private Component button;
|
||||||
[SerializeField] private string compositePartName;
|
[SerializeField] private string compositePartName;
|
||||||
[SerializeField] private Image targetImage;
|
[SerializeField] private Image targetImage;
|
||||||
|
|
||||||
@ -14,18 +14,18 @@ public sealed class InputGlyphUXButton : InputGlyphBehaviourBase
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
private void OnValidate()
|
private void OnValidate()
|
||||||
{
|
{
|
||||||
if (button == null)
|
if (button == null && TryGetComponent(typeof(IHotkeyTrigger), out Component c))
|
||||||
{
|
{
|
||||||
button = GetComponent<UXButton>();
|
button = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected override void OnEnable()
|
protected override void OnEnable()
|
||||||
{
|
{
|
||||||
if (button == null)
|
if (button == null && TryGetComponent(typeof(IHotkeyTrigger), out Component c))
|
||||||
{
|
{
|
||||||
button = GetComponent<UXButton>();
|
button = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetImage == null)
|
if (targetImage == null)
|
||||||
@ -38,7 +38,7 @@ public sealed class InputGlyphUXButton : InputGlyphBehaviourBase
|
|||||||
|
|
||||||
protected override void RefreshGlyph()
|
protected override void RefreshGlyph()
|
||||||
{
|
{
|
||||||
InputActionReference actionReference = button != null ? button.HotKeyRefrence : null;
|
InputActionReference actionReference = button != null ? (button as IHotkeyTrigger).HotkeyAction : null;
|
||||||
if (actionReference == null || actionReference.action == null || targetImage == null)
|
if (actionReference == null || actionReference.action == null || targetImage == null)
|
||||||
{
|
{
|
||||||
if (targetImage != null && _cachedSprite != null)
|
if (targetImage != null && _cachedSprite != null)
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 7b4feec0f0eb8a7af67063eda3c7a0d8d8bc2b5e
|
Subproject commit e7b0f64c056f6ad66a2b08a5b5b7feb2b31a5d2c
|
||||||
Loading…
Reference in New Issue
Block a user