2024-10-20 17:21:39 +00:00
|
|
|
using BlueWater.Interfaces;
|
|
|
|
|
|
|
|
namespace BlueWater.Npcs.Customers
|
|
|
|
{
|
2024-10-22 12:41:31 +00:00
|
|
|
public class IdleStateMachine : IStateMachine<Customer>
|
2024-10-20 17:21:39 +00:00
|
|
|
{
|
|
|
|
public void EnterState(Customer character)
|
|
|
|
{
|
|
|
|
if (character.IsVomited)
|
|
|
|
{
|
|
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.VomitingIdle, true);
|
|
|
|
}
|
|
|
|
else if (character.IsReceivedItem)
|
|
|
|
{
|
|
|
|
character.SpineController.PlayAnimation(character.IsOrderedSucceed ?
|
|
|
|
CustomerSpineAnimation.Happy : CustomerSpineAnimation.Upset, true);
|
|
|
|
}
|
|
|
|
else if (!character.IsReceivedItem)
|
|
|
|
{
|
|
|
|
character.SpineController.PlayAnimation(CustomerSpineAnimation.Idle, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void UpdateState(Customer character)
|
|
|
|
{
|
|
|
|
if (character.IsMoving)
|
|
|
|
{
|
2024-10-22 12:41:31 +00:00
|
|
|
character.StateMachineController.TransitionToState(character.WalkingState, character);
|
2024-10-20 17:21:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ExitState(Customer character)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|