38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using BlueWater.Interfaces;
|
|
|
|
namespace BlueWater.Npcs.Customers
|
|
{
|
|
public class WalkingStateMachine : IStateMachine<Customer>
|
|
{
|
|
public void EnterState(Customer character)
|
|
{
|
|
if (character.IsVomited)
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.VomitingRun, true);
|
|
}
|
|
else if (character.IsReceivedItem)
|
|
{
|
|
character.SpineController.PlayAnimation(character.IsOrderedSucceed ?
|
|
CustomerSpineAnimation.HappyRun : CustomerSpineAnimation.UpsetRun, true);
|
|
}
|
|
else if (!character.IsReceivedItem)
|
|
{
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Walk, true);
|
|
}
|
|
}
|
|
|
|
public void UpdateState(Customer character)
|
|
{
|
|
if (!character.IsMoving)
|
|
{
|
|
character.StateMachineController.TransitionToState(character.IdleState, character);
|
|
}
|
|
}
|
|
|
|
public void ExitState(Customer character)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|