优化移动平台与玩家的交互逻辑,采用速度双缓冲方案以提升运动平滑度和代码清晰度

This commit is contained in:
2026-05-21 19:27:36 +08:00
parent 39483c4460
commit 8ccfa22a0e
6 changed files with 69 additions and 35 deletions

View File

@@ -76,7 +76,13 @@ namespace BaseGames.Player.States
TryConsumeCancelInput();
}
public override void OnStateFixedUpdate() { }
public override void OnStateFixedUpdate()
{
// 攻击动画播放期间无水平输入,仍需每帧调用 Move(0) 叠加 _platformVelocity.x
// 使玩家在移动平台上攻击时仍随平台同步移动。
if (Move.IsGrounded)
Move.Move(0f);
}
// ── 内部 ──────────────────────────────────────────────────────────────