CapersProject/Assets/02.Scripts/Character/Npc/Customer/State/IdleState.cs

96 lines
3.4 KiB
C#
Raw Normal View History

2024-10-20 17:21:39 +00:00
using BlueWater.Interfaces;
namespace BlueWater.Npcs.Customers
{
2024-11-04 12:22:07 +00:00
public class IdleState : IStateMachine<Customer>
2024-10-20 17:21:39 +00:00
{
public void EnterState(Customer character)
{
if (character.IsVomited)
{
2024-12-17 12:54:30 +00:00
if (character.CustomerSkin == CustomerSkin.Cat)
{
character.SpineController.PlayAnimation(CatSpineAnimation.VomitingIdle, true);
}
else
{
character.SpineController.PlayAnimation(CustomerSpineAnimation.VomitingIdle, true);
}
2024-10-20 17:21:39 +00:00
}
else if (character.IsReceivedItem)
{
2024-12-17 12:54:30 +00:00
if (character.IsOrderedCorrected)
{
if (character.CustomerSkin == CustomerSkin.Cat)
{
character.SpineController.PlayAnimation(CatSpineAnimation.Happy, true);
}
else if (character.CustomerSkin == CustomerSkin.Witch)
{
character.SpineController.PlayAnimation(WitchSpineAnimation.Happy, true);
}
else
{
character.SpineController.PlayAnimation(CustomerSpineAnimation.Happy, true);
}
}
else
{
if (character.CustomerSkin == CustomerSkin.Cat)
{
character.SpineController.PlayAnimation(CatSpineAnimation.Upset, true);
}
else if (character.CustomerSkin == CustomerSkin.Witch)
{
character.SpineController.PlayAnimation(WitchSpineAnimation.Upset, true);
}
else
{
character.SpineController.PlayAnimation(CustomerSpineAnimation.Upset, true);
}
}
2024-10-20 17:21:39 +00:00
}
else if (!character.IsReceivedItem)
{
2024-12-17 12:54:30 +00:00
if (character.CustomerSkin == CustomerSkin.Cat)
{
character.SpineController.PlayAnimation(CatSpineAnimation.Idle, true);
}
else if (character.CustomerSkin == CustomerSkin.Witch)
{
character.SpineController.PlayAnimation(WitchSpineAnimation.Idle, true);
}
else
{
character.SpineController.PlayAnimation(CustomerSpineAnimation.Idle, true);
}
2024-10-20 17:21:39 +00:00
}
}
public void UpdateState(Customer character)
{
if (character.IsMoving)
{
2024-12-17 12:54:30 +00:00
if (character.CustomerSkin == CustomerSkin.Cat)
{
character.SpineController.PlayAnimation(CatSpineAnimation.Idle, true);
}
else if (character.CustomerSkin == CustomerSkin.Witch)
{
character.SpineController.PlayAnimation(WitchSpineAnimation.Idle, true);
}
else
{
character.SpineController.PlayAnimation(CustomerSpineAnimation.Idle, true);
}
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)
{
}
}
}