32 lines
728 B
C#
32 lines
728 B
C#
![]() |
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;
|
||
|
}
|
||
|
}
|
||
|
}
|