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

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

@@ -42,5 +42,13 @@ namespace BaseGames.Player.States
{
Owner.TransitionTo(Owner.GetState<IdleState>());
}
public override void OnStateFixedUpdate()
{
// 弹反预备期间无水平输入,仍需每帧调用 Move(0) 叠加 _platformVelocity.x
// 使玩家在移动平台上弹反时随平台同步移动。
if (Move != null && Move.IsGrounded)
Move.Move(0f);
}
}
}