- 将输入行为和动画控制进行分离;
- InputHandler:
绑定InputSystem 的 performed Action
捕获输入参数: horizontal Vertical moveAmount mouseX mouseY
实现 TickInput方法,
- PlayerLocoMotion.cs:
实现移动:
inputHandler.tickInput()
velocity ->
rb.velocity
实现旋转:
var dir = Quaternion.LookRotation(targetV);
rb.rotation = Quaternion.Slerp(rb.rotation, dir, rotationSpeed * delta);