摄像机区域的优化
This commit is contained in:
@@ -38,6 +38,7 @@ namespace BaseGames.Player.States
|
||||
}
|
||||
if (Mathf.Abs(Input.MoveInput.x) < 0.1f)
|
||||
{
|
||||
Move.ZeroHorizontalVelocity();
|
||||
_owner.TransitionTo(_owner.GetState<IdleState>());
|
||||
return;
|
||||
}
|
||||
@@ -45,7 +46,11 @@ namespace BaseGames.Player.States
|
||||
|
||||
public override void OnStateFixedUpdate()
|
||||
{
|
||||
Move.Move(Input.MoveInput.x * Cfg.RunSpeed);
|
||||
float inputX = Input.MoveInput.x;
|
||||
if (Mathf.Abs(inputX) > 0.1f)
|
||||
Move.Move(inputX * Cfg.RunSpeed);
|
||||
else
|
||||
Move.ZeroHorizontalVelocity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user