+ ItemTable excel, json, so 수정 + 손님 추가 -> 빈 자리 찾기 -> 음료 주문 -> 퇴장 구현 + 일부 BehaviorTree Action 변경
29 lines
775 B
C#
29 lines
775 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater
|
|
{
|
|
public class CustomerTable : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private List<TableSeat> _tableSeats;
|
|
|
|
private void OnEnable()
|
|
{
|
|
RestaurantManager.Instance.CustomerTableManager.RegisterTable(this);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
if (!RestaurantManager.Instance) return;
|
|
|
|
RestaurantManager.Instance.CustomerTableManager.UnregisterTable(this);
|
|
}
|
|
|
|
public TableSeat FindEmptySeat()
|
|
{
|
|
return _tableSeats.FirstOrDefault(tableSeat => !tableSeat.IsReserved && !tableSeat.IsOccupied && tableSeat.IsCleaned);
|
|
}
|
|
}
|
|
} |