aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/PlayerLocomotion.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/PlayerLocomotion.cs')
-rw-r--r--Assets/Scripts/PlayerLocomotion.cs14
1 files changed, 2 insertions, 12 deletions
diff --git a/Assets/Scripts/PlayerLocomotion.cs b/Assets/Scripts/PlayerLocomotion.cs
index e94099b..d513899 100644
--- a/Assets/Scripts/PlayerLocomotion.cs
+++ b/Assets/Scripts/PlayerLocomotion.cs
@@ -112,14 +112,7 @@ namespace DS
// ============================================================
// 每帧更新(使用 Update 处理移动逻辑,因为需要与输入同步)
// ============================================================
- private void Update()
- {
- float delta = Time.deltaTime; // 获取帧时间
- isSprinting = _inputHandler.b_Input;
- UpdateCharacterMovement(delta);
- HandleRollingAndSpringting(delta);
- }
// ============================================================
// 固定更新(当前未使用,但保留以备未来物理相关逻辑)
@@ -177,14 +170,11 @@ namespace DS
// ============================================================
// 角色移动更新(核心逻辑)
// ============================================================
- private void UpdateCharacterMovement(float delta)
+ public void UpdateCharacterMovement(float delta)
{
if (_inputHandler.rollFlag)
return;
- // 处理输入(读取水平/垂直输入值)
- _inputHandler.TickInput(delta);
-
// ----------------------------------------------------------
// 1. 计算移动方向(基于摄像机朝向)
// ----------------------------------------------------------
@@ -252,7 +242,7 @@ namespace DS
}
}
- private void HandleRollingAndSpringting(float delta)
+ public void HandleRollingAndSpringting(float delta)
{
if (animatorHandler.animator.GetBool("isInteracting"))
{