From 8537159642af167feae6f64d0614252f6016a54e Mon Sep 17 00:00:00 2001 From: SmallFox <2806143047@qq.com> Date: Tue, 2 Jun 2026 19:38:24 +0800 Subject: 冲刺 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/InputHandler.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Assets/Scripts/InputHandler.cs') diff --git a/Assets/Scripts/InputHandler.cs b/Assets/Scripts/InputHandler.cs index 8144da7..9f57c20 100644 --- a/Assets/Scripts/InputHandler.cs +++ b/Assets/Scripts/InputHandler.cs @@ -30,6 +30,8 @@ namespace DS public bool b_Input; public bool rollFlag; + public bool sprintFlag; + public float rollInputTimer; public bool isInteracting; [Header("其他操作输入")] @@ -136,7 +138,18 @@ namespace DS b_Input = _inputActions.PlayerActions.Roll.phase == UnityEngine.InputSystem.InputActionPhase.Performed; if (b_Input) { - rollFlag = true; + rollInputTimer += delta; + sprintFlag = true; + } + else + { + if (rollInputTimer > 0 && rollInputTimer < 0.5) + { + rollFlag = true; + sprintFlag = false; + } + + rollInputTimer = 0; } } } -- cgit