32 lines
690 B (Stored with Git LFS)
C#
32 lines
690 B (Stored with Git LFS)
C#
namespace DDD
|
|
{
|
|
public class WalkingState : IStateMachine
|
|
{
|
|
private RestaurantPlayer _player;
|
|
private RestaurantPlayerView _view;
|
|
|
|
public WalkingState(RestaurantPlayer player, RestaurantPlayerView view)
|
|
{
|
|
_player = player;
|
|
_view = view;
|
|
}
|
|
|
|
public void Enter()
|
|
{
|
|
_view.PlayAnimation(RestaurantSpineAnimation.Walking, true);
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
if (!_player.IsMoving)
|
|
{
|
|
_player.ChangeState(new IdleState(_player, _view));
|
|
}
|
|
}
|
|
|
|
public void Exit()
|
|
{
|
|
|
|
}
|
|
}
|
|
} |