diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-30 17:05:13 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-30 17:05:13 +0800 |
| commit | 14a01125a885ee4dbd2de6c1f57bbcd12ca12110 (patch) | |
| tree | 0d2ee7539c26a495132c9b7d8c1c4e5d87d7a19b /Assets/Scripts/InputSystem/PlayerControls.cs | |
| parent | f33ad8a7aa7359653fd2d98a8645e01087637980 (diff) | |
完成动画中翻滚的绑定
Diffstat (limited to 'Assets/Scripts/InputSystem/PlayerControls.cs')
| -rw-r--r-- | Assets/Scripts/InputSystem/PlayerControls.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Assets/Scripts/InputSystem/PlayerControls.cs b/Assets/Scripts/InputSystem/PlayerControls.cs index c76f6ba..c77acf2 100644 --- a/Assets/Scripts/InputSystem/PlayerControls.cs +++ b/Assets/Scripts/InputSystem/PlayerControls.cs @@ -44,6 +44,15 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable ""processors"": """", ""interactions"": """", ""initialStateCheck"": true + }, + { + ""name"": ""Roll"", + ""type"": ""Button"", + ""id"": ""5e423815-95ec-43c1-9718-224f86c8f24e"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false } ], ""bindings"": [ @@ -123,6 +132,17 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable ""action"": ""Camera"", ""isComposite"": false, ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""4690e573-c6d7-4c20-bbee-ba5d11ca8a18"", + ""path"": ""<Keyboard>/space"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Roll"", + ""isComposite"": false, + ""isPartOfComposite"": false } ] } @@ -133,6 +153,7 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable m_PlayerMovement = asset.FindActionMap("Player Movement", throwIfNotFound: true); m_PlayerMovement_Movement = m_PlayerMovement.FindAction("Movement", throwIfNotFound: true); m_PlayerMovement_Camera = m_PlayerMovement.FindAction("Camera", throwIfNotFound: true); + m_PlayerMovement_Roll = m_PlayerMovement.FindAction("Roll", throwIfNotFound: true); } public void Dispose() @@ -196,12 +217,14 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable private List<IPlayerMovementActions> m_PlayerMovementActionsCallbackInterfaces = new List<IPlayerMovementActions>(); private readonly InputAction m_PlayerMovement_Movement; private readonly InputAction m_PlayerMovement_Camera; + private readonly InputAction m_PlayerMovement_Roll; public struct PlayerMovementActions { private @PlayerControls m_Wrapper; public PlayerMovementActions(@PlayerControls wrapper) { m_Wrapper = wrapper; } public InputAction @Movement => m_Wrapper.m_PlayerMovement_Movement; public InputAction @Camera => m_Wrapper.m_PlayerMovement_Camera; + public InputAction @Roll => m_Wrapper.m_PlayerMovement_Roll; public InputActionMap Get() { return m_Wrapper.m_PlayerMovement; } public void Enable() { Get().Enable(); } public void Disable() { Get().Disable(); } @@ -217,6 +240,9 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable @Camera.started += instance.OnCamera; @Camera.performed += instance.OnCamera; @Camera.canceled += instance.OnCamera; + @Roll.started += instance.OnRoll; + @Roll.performed += instance.OnRoll; + @Roll.canceled += instance.OnRoll; } private void UnregisterCallbacks(IPlayerMovementActions instance) @@ -227,6 +253,9 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable @Camera.started -= instance.OnCamera; @Camera.performed -= instance.OnCamera; @Camera.canceled -= instance.OnCamera; + @Roll.started -= instance.OnRoll; + @Roll.performed -= instance.OnRoll; + @Roll.canceled -= instance.OnRoll; } public void RemoveCallbacks(IPlayerMovementActions instance) @@ -248,5 +277,6 @@ public partial class @PlayerControls: IInputActionCollection2, IDisposable { void OnMovement(InputAction.CallbackContext context); void OnCamera(InputAction.CallbackContext context); + void OnRoll(InputAction.CallbackContext context); } } |
