private void OnTriggerExit(Collider other) { if (other.gameObject.GetComponent <CarFrontCollider>() == null) { return; } VehicleBehaviour vehicle = other.gameObject.GetComponentInParent <VehicleBehaviour>(); if (vehicle == null) { return; } vehicle.BuildNextPath(); _controller.CheckRemove(vehicle); }
private void OnTriggerExit(Collider other) { if (other.gameObject.GetComponent <CarFrontCollider>() == null) { return; } VehicleAtLight = other.gameObject.GetComponentInParent <VehicleBehaviour>(); if (VehicleAtLight == null) { return; } if (VehicleAtLight.NextRoad == null && !VehicleAtLight.IsUnableToMove) { VehicleAtLight.SetNextRoad(); } _controller.CheckRemoveZ(VehicleAtLight); VehicleAtLight.BuildNextPath(); VehicleAtLight.LightStopZs.Remove(this); VehicleAtLight = null; }