// Update is called once per frame void Update() { if (input.IsBraking() || input.IsHandbraking()) { IntensifierLuminosite(); } else { AllumerNormalementLumieres(); } }
void Update() { float brakeTorqueToApply = vehicleInput.GetBraking() * brakeTorque; float steerAngle = Input.GetAxis("Horizontal") * maxSteerAngle; foreach (Wheel wheel in wheels) { if (wheel.steering) { wheel.WheelCollider.steerAngle = steerAngle; } if (wheel.braking) { wheel.WheelCollider.brakeTorque = brakeTorqueToApply; } if (wheel.handbraking) { if (vehicleInput.IsHandbraking()) { wheel.WheelCollider.brakeTorque = handbrakeTorque; wheel.EnableHandbrakeFriction(); if (wheel.braking) { wheel.WheelCollider.brakeTorque += brakeTorqueToApply; } } else { wheel.DisableHandbrakeFriction(); } } } }