/// <summary> /// 添加排队人物 /// </summary> /// <param name="item"></param> public void Enqueue(IQueueUp item) { Vector2 tailPosition = HeadPosition + Space * QueueDirection * queue.Count; item.SetQueuePosition(tailPosition); item.OnEnqueue(this); queue.Enqueue(item); }
public IQueueUp Dequeue() { if (queue.Count == 0) { return(null); } IQueueUp dequeueObj = queue.Dequeue(); RefreshPositions(); dequeueObj.OnDequeue(); return(dequeueObj); }
public void RemoveItem(IQueueUp item) { queue = new Queue <IQueueUp>(queue.Where(i => i != item)); }