opt
修改命名空间
This commit is contained in:
parent
32c0fc13fd
commit
d17eaaaa8b
@ -2,13 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using AlicizaX.Editor;
|
||||
using AlicizaX.UI.Extension;
|
||||
using AlicizaX.UI.Extension.UXComponent.Hotkey;
|
||||
using AlicizaX.UI.Runtime;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEngine.UI
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[CustomEditor(typeof(HotkeyBindComponent))]
|
||||
public class HotkeyBindComponentInspector : GameFrameworkInspector
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
using AlicizaX.Editor;
|
||||
using AlicizaX.UI.Extension;
|
||||
#if INPUTSYSTEM_SUPPORT
|
||||
using AlicizaX.UI;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEngine.UI
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(UXHotkeyButton), true)]
|
||||
@ -29,3 +30,5 @@ namespace UnityEngine.UI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
// Assets/Scripts/AlicizaX/UI/IControllerState.cs
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AlicizaX.UI.Runtime
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
public abstract class ControllerStateBase
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace AlicizaX.UI.Runtime
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[Serializable]
|
||||
[ControlerStateName("GameObject/Visiblity")]
|
||||
|
||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AlicizaX.UI.Runtime
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
[AddComponentMenu("Controller/控制器")]
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
namespace AlicizaX.UI.Runtime
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
[AddComponentMenu("Controller/控制器状态")]
|
||||
|
||||
@ -4,7 +4,10 @@ using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
|
||||
namespace UnityEngine.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
[ExecuteAlways]
|
||||
public class UXGroup : UIBehaviour
|
||||
{
|
||||
[SerializeField] private bool m_AllowSwitchOff;
|
||||
@ -137,3 +140,4 @@ public class UXGroup : UIBehaviour
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
using AlicizaX.UI.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AlicizaX.UI.Extension.UXComponent.Hotkey
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public class HotkeyBindComponent : MonoBehaviour
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
#if INPUTSYSTEM_SUPPORT
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace AlicizaX.UI.Extension
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public class UXHotkeyButton : UXButton
|
||||
{
|
||||
[SerializeField] internal UnityEngine.InputSystem.InputActionReference _hotKeyRefrence;
|
||||
[SerializeField] internal InputActionReference _hotKeyRefrence;
|
||||
[SerializeField] internal EHotkeyPressType _hotkeyPressType;
|
||||
|
||||
internal void HotkeyActionTrigger()
|
||||
@ -17,3 +19,5 @@ namespace AlicizaX.UI.Extension
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
#if INPUTSYSTEM_SUPPORT
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using AlicizaX.UI.Extension;
|
||||
using AlicizaX.UI;
|
||||
using UnityEditor.Callbacks;
|
||||
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
internal enum EHotkeyPressType
|
||||
{
|
||||
Started,
|
||||
@ -25,20 +29,18 @@ internal static class UXHotkeyRegisterManager
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, List<HotkeyRegistration>> _hotkeyRegistry =
|
||||
new Dictionary<string, List<HotkeyRegistration>>(32);
|
||||
private static readonly Dictionary<string, List<HotkeyRegistration>> _hotkeyRegistry = new(32);
|
||||
|
||||
|
||||
private static readonly Dictionary<string, (System.Action<InputAction.CallbackContext> handler, InputActionReference action)> _sharedHandlers =
|
||||
new Dictionary<string, (System.Action<InputAction.CallbackContext>, InputActionReference)>(32);
|
||||
private static readonly Dictionary<string, (Action<InputAction.CallbackContext> handler, InputActionReference action)> _sharedHandlers =
|
||||
new(32);
|
||||
|
||||
|
||||
private static readonly Dictionary<UXHotkeyButton, string> _buttonRegistrations =
|
||||
new Dictionary<UXHotkeyButton, string>(64);
|
||||
private static readonly Dictionary<UXHotkeyButton, string> _buttonRegistrations = new(64);
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[UnityEditor.Callbacks.DidReloadScripts]
|
||||
[DidReloadScripts]
|
||||
internal static void ClearHotkeyRegistry()
|
||||
{
|
||||
foreach (var key in _buttonRegistrations.Keys)
|
||||
@ -76,7 +78,7 @@ internal static class UXHotkeyRegisterManager
|
||||
|
||||
if (!_sharedHandlers.ContainsKey(actionId))
|
||||
{
|
||||
System.Action<InputAction.CallbackContext> handler = ctx => OnHotkeyTriggered(actionId);
|
||||
Action<InputAction.CallbackContext> handler = ctx => OnHotkeyTriggered(actionId);
|
||||
_sharedHandlers[actionId] = (handler, action);
|
||||
|
||||
switch (pressType)
|
||||
@ -148,6 +150,7 @@ internal static class UXHotkeyRegisterManager
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class UXHotkeyHotkeyExtension
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@ using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace AlicizaX.UI.Extension
|
||||
namespace AlicizaX.UI
|
||||
{
|
||||
public class UXDraggable:MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user