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

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

@@ -49,5 +49,12 @@ namespace BaseGames.Player.States
else
Owner.TransitionTo(Owner.GetState<FallState>());
}
public override void OnStateFixedUpdate()
{
// 地面上劈期间调用 Move(0) 叠加 _platformVelocity.x使玩家随移动平台同步移动。
if (Move != null && Move.IsGrounded)
Move.Move(0f);
}
}
}