public void DeliverKeptAsideOrderTo(ResourceCarrier recipient) { ResourceShipment orderedShipment = null; IEnumerator <AgoraMerchant> merchantsEnumerator = _agora.MerchantsEnumerator(); while (merchantsEnumerator.MoveNext()) { AgoraMerchant merchant = merchantsEnumerator.Current; KeepAsideOrderManager merchantOrderManager = merchant.GetComponent <KeepAsideOrderManager>(); if (merchantOrderManager != null) { if (orderedShipment != null) { orderedShipment.AddShipment(merchantOrderManager.DeliverKeptAside(recipient)); } else { orderedShipment = merchantOrderManager.DeliverKeptAside(recipient); } } } recipient.shipment = orderedShipment; }
private IEnumerator DeliveryCoroutine(ResourceCarrier carrier) { KeepAsideOrderManager keepAsideOrderManager = freightAreaData.parentStock.GetComponent <KeepAsideOrderManager>(); yield return(new WaitForSeconds(waterDeliveryTime)); ResourceShipment order = keepAsideOrderManager.DeliverKeptAside(carrier); carrier.shipment = order; carrier.destination = carrier.origin; carrier.GetComponent <RoadRouteManager>().MoveTo(carrier.destination.freightAreaData.freightAreaIn.road); }
protected override void OnFreightAreaEntered(Collider2D other) { ResourceCarrier carrier = other.GetComponent <ResourceCarrier>(); if (carrier != null && carrier.collectingResources && carrier.destination == freightAreaData.parentStock) { KeepAsideOrderManager keepAsideOrderManager = freightAreaData.parentStock.GetComponent <KeepAsideOrderManager>(); carrier.shipment = keepAsideOrderManager.DeliverKeptAside(carrier); freightAreaData.SendBack(carrier); } }