2024-10-20 17:21:39 +00:00
|
|
|
using BehaviorDesigner.Runtime.Tasks;
|
2025-02-10 02:13:46 +00:00
|
|
|
using DDD.Npcs.Crews.Server;
|
|
|
|
using DDD.Tycoons;
|
2024-10-22 12:41:31 +00:00
|
|
|
using UnityEngine;
|
2024-10-20 17:21:39 +00:00
|
|
|
|
2025-02-10 02:13:46 +00:00
|
|
|
namespace DDD.BehaviorTrees.Actions
|
2024-10-20 17:21:39 +00:00
|
|
|
{
|
|
|
|
[TaskCategory("Custom/Npc/Crew/ServerCrew")]
|
|
|
|
public class Refind : Action
|
|
|
|
{
|
|
|
|
private ServerCrew _serverCrew;
|
|
|
|
|
|
|
|
public override void OnAwake()
|
|
|
|
{
|
|
|
|
_serverCrew = GetComponent<ServerCrew>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override TaskStatus OnUpdate()
|
|
|
|
{
|
|
|
|
var tycoonManager = TycoonManager.Instance;
|
|
|
|
var orderedCustomer = tycoonManager.CustomerController.FindCustomerMatchingItem(_serverCrew.CurrentPickupItem);
|
2024-10-22 12:41:31 +00:00
|
|
|
if (orderedCustomer)
|
2024-10-20 17:21:39 +00:00
|
|
|
{
|
2024-10-27 09:44:22 +00:00
|
|
|
_serverCrew.OnMission(orderedCustomer, orderedCustomer, ActionType.ServingToCustomer);
|
2024-10-20 17:21:39 +00:00
|
|
|
|
|
|
|
return TaskStatus.Success;
|
|
|
|
}
|
|
|
|
|
2025-02-17 21:47:56 +00:00
|
|
|
// var emptyServingTable = tycoonManager.ServingTableController.FindEmptyServingTable();
|
|
|
|
// if (emptyServingTable)
|
|
|
|
// {
|
|
|
|
// _serverCrew.OnMission(emptyServingTable, null, ActionType.PlaceOnServingTable);
|
|
|
|
// return TaskStatus.Success;
|
|
|
|
// }
|
2024-10-20 17:21:39 +00:00
|
|
|
|
2024-10-22 12:41:31 +00:00
|
|
|
return TaskStatus.Running;
|
2024-10-20 17:21:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|