/// <summary> /// Puts resources in attached resource controller from caravan /// </summary> /// <param name="other">Caravan with resources</param> void deliverResources(Collider caravan) { RTSUnitInventory inv = caravan.GetComponent <RTSUnitInventory>(); foreach (var v in inv.inventory) { attachedController.AddResource(v.CargoType); } inv.inventory.Clear(); }
// Start is called before the first frame update void Start() { inventory = GetComponent<RTSUnitInventory>(); health = GetComponent<HealthController>(); }