aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/AnimatorHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/AnimatorHandler.cs')
-rw-r--r--Assets/Scripts/AnimatorHandler.cs8
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 秒内平滑过渡到目标值