|
@@ -17,6 +17,7 @@ namespace Controller
|
|
public float leanMultiplier = 20f;
|
|
public float leanMultiplier = 20f;
|
|
public float steerMultiplier = 15f;
|
|
public float steerMultiplier = 15f;
|
|
|
|
|
|
|
|
+ private float accelerationLoss = 0.5f;
|
|
private float acceleration;
|
|
private float acceleration;
|
|
private float lean;
|
|
private float lean;
|
|
private float steer;
|
|
private float steer;
|
|
@@ -31,13 +32,14 @@ namespace Controller
|
|
{
|
|
{
|
|
if (useSteer) bicycleController.CurrentSteerAngle = steer;
|
|
if (useSteer) bicycleController.CurrentSteerAngle = steer;
|
|
if (useLean) bicycleController.CurrentLeaningAngle = lean;
|
|
if (useLean) bicycleController.CurrentLeaningAngle = lean;
|
|
- if (useSpeed) bicycleController.CurrentSpeed += acceleration;
|
|
|
|
|
|
+ if (useSpeed) bicycleController.CurrentSpeed += acceleration * Time.deltaTime;
|
|
}
|
|
}
|
|
|
|
|
|
[UsedImplicitly]
|
|
[UsedImplicitly]
|
|
public void OnSpeed(InputValue value)
|
|
public void OnSpeed(InputValue value)
|
|
{
|
|
{
|
|
acceleration = value.Get<float>() * speedMultiplier;
|
|
acceleration = value.Get<float>() * speedMultiplier;
|
|
|
|
+ if (acceleration < 0.1f && acceleration >= 0) acceleration = -accelerationLoss;
|
|
}
|
|
}
|
|
|
|
|
|
[UsedImplicitly]
|
|
[UsedImplicitly]
|