CapersProject/Assets/02.Scripts/DDD/BehaviorTree/Npc/Conditional/OrderCook.cs

32 lines
728 B
C#
Raw Normal View History

2025-02-17 21:47:56 +00:00
using System;
using BehaviorDesigner.Runtime.Tasks;
using DDD.Npcs.Customers;
namespace DDD.BehaviorTrees.Actions
{
[TaskCategory("Custom/Npc/Customer")]
[Serializable]
public class OrderCook : Conditional
{
private Customer _customer;
public override void OnAwake()
{
_customer = GetComponent<Customer>();
}
public override void OnStart()
{
_customer.OrderCook();
}
public override TaskStatus OnUpdate()
{
if (!_customer.IsReceivedItem) return TaskStatus.Running;
_customer.UnregisterPlayerInteraction();
return TaskStatus.Success;
}
}
}