diff --git a/Client/Assets/Scripts/CustomeModule/InputGlyph/Editor/InputGlyphDatabaseEditor.cs b/Client/Assets/Scripts/CustomeModule/InputGlyph/Editor/InputGlyphDatabaseEditor.cs index 734a534..a943608 100644 --- a/Client/Assets/Scripts/CustomeModule/InputGlyph/Editor/InputGlyphDatabaseEditor.cs +++ b/Client/Assets/Scripts/CustomeModule/InputGlyph/Editor/InputGlyphDatabaseEditor.cs @@ -18,11 +18,11 @@ public sealed class InputGlyphDatabaseEditor : Editor private const float PreviewSize = 52f; private const float ListPreviewSize = 56f; 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 int[] EntriesPerPageOptions = { 25, 50, 100, 200 }; - private static readonly string[] EntriesPerPageLabels = { "25 / 页", "50 / 页", "100 / 页", "200 / 页" }; + private static readonly int[] EntriesPerPageOptions = { 10, 15, 20, 25 }; + private static readonly string[] EntriesPerPageLabels = { "10 / 页", "15 / 页", "20 / 页", "25 / 页" }; private sealed class TableEditorState { diff --git a/Client/Assets/Scripts/CustomeModule/InputGlyph/InputDeviceWatcher.cs b/Client/Assets/Scripts/CustomeModule/InputGlyph/InputDeviceWatcher.cs index d942990..4c8584d 100644 --- a/Client/Assets/Scripts/CustomeModule/InputGlyph/InputDeviceWatcher.cs +++ b/Client/Assets/Scripts/CustomeModule/InputGlyph/InputDeviceWatcher.cs @@ -114,10 +114,10 @@ public static class InputDeviceWatcher _anyInputAction = new InputAction("AnyDevice", InputActionType.PassThrough); _anyInputAction.AddBinding("/anyKey"); - _anyInputAction.AddBinding("/leftButton"); - _anyInputAction.AddBinding("/rightButton"); - _anyInputAction.AddBinding("/middleButton"); - _anyInputAction.AddBinding("/scroll"); + // _anyInputAction.AddBinding("/leftButton"); + // _anyInputAction.AddBinding("/rightButton"); + // _anyInputAction.AddBinding("/middleButton"); + // _anyInputAction.AddBinding("/scroll"); _anyInputAction.AddBinding("/*"); _anyInputAction.AddBinding("/*"); _anyInputAction.performed += OnAnyInputPerformed; diff --git a/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphUXButton.cs b/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphIHotkeyTrigger.cs similarity index 77% rename from Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphUXButton.cs rename to Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphIHotkeyTrigger.cs index 8d36ecf..61b1d13 100644 --- a/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphUXButton.cs +++ b/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphIHotkeyTrigger.cs @@ -3,9 +3,9 @@ using UnityEngine.InputSystem; using UnityEngine.UI; [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 Image targetImage; @@ -14,18 +14,18 @@ public sealed class InputGlyphUXButton : InputGlyphBehaviourBase #if UNITY_EDITOR private void OnValidate() { - if (button == null) + if (button == null && TryGetComponent(typeof(IHotkeyTrigger), out Component c)) { - button = GetComponent(); + button = c; } } #endif protected override void OnEnable() { - if (button == null) + if (button == null && TryGetComponent(typeof(IHotkeyTrigger), out Component c)) { - button = GetComponent(); + button = c; } if (targetImage == null) @@ -38,7 +38,7 @@ public sealed class InputGlyphUXButton : InputGlyphBehaviourBase 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 (targetImage != null && _cachedSprite != null) diff --git a/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphUXButton.cs.meta b/Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphIHotkeyTrigger.cs.meta similarity index 100% rename from Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphUXButton.cs.meta rename to Client/Assets/Scripts/CustomeModule/InputGlyph/InputGlyphIHotkeyTrigger.cs.meta diff --git a/Client/Packages/com.alicizax.unity.ui.extension b/Client/Packages/com.alicizax.unity.ui.extension index 7b4feec..e7b0f64 160000 --- a/Client/Packages/com.alicizax.unity.ui.extension +++ b/Client/Packages/com.alicizax.unity.ui.extension @@ -1 +1 @@ -Subproject commit 7b4feec0f0eb8a7af67063eda3c7a0d8d8bc2b5e +Subproject commit e7b0f64c056f6ad66a2b08a5b5b7feb2b31a5d2c