From 14a01125a885ee4dbd2de6c1f57bbcd12ca12110 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sat, 30 May 2026 17:05:13 +0800 Subject: 完成动画中翻滚的绑定 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/InputHandler.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Assets/Scripts/InputHandler.cs') diff --git a/Assets/Scripts/InputHandler.cs b/Assets/Scripts/InputHandler.cs index 6da34f0..9d2ab72 100644 --- a/Assets/Scripts/InputHandler.cs +++ b/Assets/Scripts/InputHandler.cs @@ -28,6 +28,10 @@ namespace DS [Tooltip("鼠标或右摇杆的垂直移动增量")] public float mouseY; + [Header("其他操作输入")] + [Tooltip("翻滚是否触发")] + public bool rollTriggered; + // ===== 私有引用与输入缓存 ===== private PlayerControls _inputActions; // 新输入系统生成的 PlayerControls 实例 private CameraHandler _cameraHandler; // 相机处理器单例引用 @@ -76,6 +80,10 @@ namespace DS // 当视角控制被触发(鼠标移动/右摇杆)时,将输入值存入 _cameraInput _inputActions.PlayerMovement.Camera.performed += ctx => _cameraInput = ctx.ReadValue(); + + // 增加翻滚行为 + _inputActions.PlayerMovement.Roll.performed += + ctx => rollTriggered = ctx.ReadValueAsButton(); } // 启用输入动作监听 -- cgit