CapersProject/Assets/02.Scripts/Prop/Tycoon/CustomerTable.cs
Nam Tae Gun 04fbc8c7d4 #7 상호작용 가구 추가 중
+ FireWood, Pot, PowerSwitch 가구 추가
+ GameTimeData 추가
2024-07-09 05:06:22 +09:00

29 lines
777 B
C#

using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace BlueWater.Tycoons
{
public class CustomerTable : MonoBehaviour
{
[SerializeField]
private List<TableSeat> _tableSeats;
private void OnEnable()
{
TycoonManager.Instance.CustomerTableController.RegisterTable(this);
}
private void OnDisable()
{
if (!TycoonManager.Instance) return;
TycoonManager.Instance.CustomerTableController.UnregisterTable(this);
}
public TableSeat FindEmptySeat()
{
return _tableSeats.FirstOrDefault(tableSeat => !tableSeat.IsReserved && !tableSeat.IsOccupied && tableSeat.IsCleaned);
}
}
}