aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/InputSystem
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-30 17:05:13 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-30 17:05:13 +0800
commit14a01125a885ee4dbd2de6c1f57bbcd12ca12110 (patch)
tree0d2ee7539c26a495132c9b7d8c1c4e5d87d7a19b /Assets/Scripts/InputSystem
parentf33ad8a7aa7359653fd2d98a8645e01087637980 (diff)
完成动画中翻滚的绑定
Diffstat (limited to 'Assets/Scripts/InputSystem')
-rw-r--r--Assets/Scripts/InputSystem/PlayerControls.cs30
-rw-r--r--Assets/Scripts/InputSystem/PlayerControls.inputactions20
2 files changed, 50 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);
}
}
diff --git a/Assets/Scripts/InputSystem/PlayerControls.inputactions b/Assets/Scripts/InputSystem/PlayerControls.inputactions
index e71a5c9..f3edee9 100644
--- a/Assets/Scripts/InputSystem/PlayerControls.inputactions
+++ b/Assets/Scripts/InputSystem/PlayerControls.inputactions
@@ -22,6 +22,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": true
+ },
+ {
+ "name": "Roll",
+ "type": "Button",
+ "id": "5e423815-95ec-43c1-9718-224f86c8f24e",
+ "expectedControlType": "Button",
+ "processors": "",
+ "interactions": "",
+ "initialStateCheck": false
}
],
"bindings": [
@@ -101,6 +110,17 @@
"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
}
]
}