+ ItemTable excel, json, so 수정 + 손님 추가 -> 빈 자리 찾기 -> 음료 주문 -> 퇴장 구현 + 일부 BehaviorTree Action 변경
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System;
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
using BlueWater.Npcs.Customers;
|
|
using Action = BehaviorDesigner.Runtime.Tasks.Action;
|
|
|
|
namespace BlueWater.BehaviorTrees.Actions
|
|
{
|
|
[TaskCategory("Custom/Npc/Customer")]
|
|
[Serializable]
|
|
public class OrderFood : Action
|
|
{
|
|
private Customer _customer;
|
|
private FoodBalloonUi _foodBalloonUi;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
_customer = GetComponent<Customer>();
|
|
}
|
|
|
|
public override void OnStart()
|
|
{
|
|
_foodBalloonUi = _customer.FoodBalloonUi;
|
|
_foodBalloonUi.OrderFood(40001, 15f);
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
if (_foodBalloonUi.IsFoodReceive())
|
|
{
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
if (_foodBalloonUi.IsWaitTimeOver())
|
|
{
|
|
_foodBalloonUi.CancelOrder();
|
|
return TaskStatus.Failure;
|
|
}
|
|
|
|
return TaskStatus.Running;
|
|
}
|
|
}
|
|
} |