using System; using System.Collections; using System.Collections.Generic; using System.Linq; using Script; using UnityEngine; public class WaitSlot : MonoBehaviour { public List waits => waitGrids; [SerializeField] private List waitGrids; private void Awake() { foreach (var grid in waitGrids) { grid.action = AniEndEvent; } } /// /// 判断是否有可移动位置 /// /// /// public bool MoveOpen(out Grid mGrid) { mGrid = null; foreach (var grid in waitGrids.Where(grid => grid.passenger==null)) { mGrid = grid; return true; } return false; } /// /// 到达等待区域事件 /// public void AniEndEvent() { GameManager.ins.MoveCarEvent(); } }