void OnTriggerEnter(Collider other) { MSVehicleController controller = other.transform.GetComponentInParent <MSVehicleController> (); if (controller) { float max = controller._fuel.capacityInLiters; controller.currentFuelLiters += fuel; controller.currentFuelLiters = Mathf.Clamp(controller.currentFuelLiters, 0, max); } }
void Start() { _AILogicComponent = GetComponent <MSVehicleController> (); }