CapersProject/Assets/02.Scripts/Tycoon/ServingTableController.cs

25 lines
643 B
C#
Raw Normal View History

2024-10-15 18:01:16 +00:00
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace BlueWater.Tycoons
{
public class ServingTableController : MonoBehaviour
{
[SerializeField]
private Transform _servingTableRoot;
[SerializeField]
private List<ServingTable> _servingTables;
private void Awake()
{
_servingTables = _servingTableRoot.GetComponentsInChildren<ServingTable>().ToList();
}
2024-10-20 17:21:39 +00:00
public ServingTable FindEmptyServingTable()
{
return _servingTables.FirstOrDefault(element => element.CurrentPickupItem == null);
}
2024-10-15 18:01:16 +00:00
}
}