private void SetEngineParameters() { float speed = 0; PhysicsUtilities.ScaleValueWithSpeed(ref speed, 0, 1, Handling.RB, Handling.MaxSpeed); Engine.SetParameter("Speed", speed); Engine.SetParameter("Force", Handling.ThrustInput); if (Handling.IsCarving) { float driftAmount = Mathf.Clamp(Mathf.Abs(Handling.TurnInput), 0.4f, 1.0f); Engine.SetParameter("Drift", driftAmount); } }
private void UpdateSpeedGauge() { float fill = SpeedGaugeImage.fillAmount; PhysicsUtilities.ScaleValueWithSpeed(ref fill, 0, 1, Handling.RB, Handling.MaxSpeed); SpeedGaugeImage.fillAmount = fill; SpeedGaugeImage.material.SetFloat("_GlowIntensity", fill); if (Handling.IsDashing) { SpeedGaugeImage.material.SetColor("_HDRColor", DashColor); } else { SpeedGaugeImage.material.SetColor("_HDRColor", DefaultColor); } }
private void ScaleXOffsetWithSpeed() { PhysicsUtilities.ScaleValueWithSpeed(ref XSpeedMultiplier, 0, 1, RB, Handling.MaxSpeed); }
private void ScaleZOffsetWithSpeed() { PhysicsUtilities.ScaleValueWithSpeed(ref ZOffset, 0, MaxZOffset, RB, Handling.MaxSpeed); }