diff options
| author | SmallFox <2806143047@qq.com> | 2026-06-02 19:38:24 +0800 |
|---|---|---|
| committer | SmallFox <2806143047@qq.com> | 2026-06-02 19:38:24 +0800 |
| commit | 8537159642af167feae6f64d0614252f6016a54e (patch) | |
| tree | 08a37d50ef9c808a7c0df1799e03add76dec5bdc /Assets/Scripts/AnimatorHandler.cs | |
| parent | 37618e6e39aa58130f4237995753bcf202da136a (diff) | |
冲刺
Diffstat (limited to 'Assets/Scripts/AnimatorHandler.cs')
| -rw-r--r-- | Assets/Scripts/AnimatorHandler.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Assets/Scripts/AnimatorHandler.cs b/Assets/Scripts/AnimatorHandler.cs index 775ffc4..157b78f 100644 --- a/Assets/Scripts/AnimatorHandler.cs +++ b/Assets/Scripts/AnimatorHandler.cs @@ -55,7 +55,7 @@ namespace DS /// </summary> /// <param name="verticalMovement">垂直方向的移动输入(前进/后退),范围 -1 ~ 1</param> /// <param name="horizontalMovement">水平方向的移动输入(左移/右移),范围 -1 ~ 1</param> - public void UpdateAnimatorValues(float verticalMovement, float horizontalMovement) + public void UpdateAnimatorValues(float verticalMovement, float horizontalMovement,bool isSprinting) { #region Vertical — 垂直方向(前进/后退)的动画参数处理 @@ -114,6 +114,12 @@ namespace DS } #endregion + + if (isSprinting) + { + v = 2; + h = horizontalMovement; + } // 将计算后的参数值设置到 Animator 中 // 第三个参数 dampTime 为 0.1f,表示在 0.1 秒内平滑过渡到目标值 |
