From ff1e4698f877ead17ee723ff465f26fad58cd0a0 Mon Sep 17 00:00:00 2001 From: SmallFox <2806143047@qq.com> Date: Sun, 31 May 2026 17:42:01 +0800 Subject: 合并最新分支,重构Roll,增加了Step_Back,有点手感问题后面调 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/InputHandler.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Assets/Scripts/InputHandler.cs') diff --git a/Assets/Scripts/InputHandler.cs b/Assets/Scripts/InputHandler.cs index 9d2ab72..e1c70d0 100644 --- a/Assets/Scripts/InputHandler.cs +++ b/Assets/Scripts/InputHandler.cs @@ -28,6 +28,10 @@ namespace DS [Tooltip("鼠标或右摇杆的垂直移动增量")] public float mouseY; + public bool b_Input; + public bool rollFlag; + public bool isInteracting; + [Header("其他操作输入")] [Tooltip("翻滚是否触发")] public bool rollTriggered; @@ -81,9 +85,6 @@ namespace DS _inputActions.PlayerMovement.Camera.performed += ctx => _cameraInput = ctx.ReadValue(); - // 增加翻滚行为 - _inputActions.PlayerMovement.Roll.performed += - ctx => rollTriggered = ctx.ReadValueAsButton(); } // 启用输入动作监听 @@ -107,6 +108,7 @@ namespace DS public void TickInput(float delta) { MoveInput(delta); + HandleRollInput(delta); } // ===== 私有输入处理逻辑 ===== @@ -128,5 +130,15 @@ namespace DS mouseX = _cameraInput.x; mouseY = _cameraInput.y; } + + private void HandleRollInput(float delta) + { + b_Input = _inputActions.PlayerActions.Roll.phase == UnityEngine.InputSystem.InputActionPhase.Performed; + Debug.Log(b_Input); + if (b_Input) + { + rollFlag = true; + } + } } } -- cgit