Exemple #1
0
    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);
        }
    }
Exemple #2
0
    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);
        }
    }
Exemple #3
0
 private void ScaleXOffsetWithSpeed()
 {
     PhysicsUtilities.ScaleValueWithSpeed(ref XSpeedMultiplier, 0, 1, RB, Handling.MaxSpeed);
 }
Exemple #4
0
 private void ScaleZOffsetWithSpeed()
 {
     PhysicsUtilities.ScaleValueWithSpeed(ref ZOffset, 0, MaxZOffset, RB, Handling.MaxSpeed);
 }