private void StartDelivery() { List <int> checkedDeliverySpots = new List <int>(); GameObject Deliverables; for (int i = 0; i < ItemsPerDelivery; i++) { DeliverySpot DropSpot = AvailableDeliveryPoints[Random.Range(0, AvailableDeliveryPoints.Count - 1)]; AvailableDeliveryPoints.Remove(DropSpot); int index = Random.Range(0, ItemsSpawned.Count - 1); Deliverables = ItemsSpawned[index]; RemoveItemFromList(ItemsSpawned[index]); DropSpot.StartDelivery(Deliverables); } TimeUntilNextDelivery = TimeBetweenDeliveries + Time.time; }
public void CompleteDelivery(DeliverySpot spot) { AvailableDeliveryPoints.Add(spot); }