Exemplo n.º 1
0
    void Update()
    {
        float lerp = (motor.GetCurrentThrust() + 1.0f) / 2.0f;

        if (motor.IsBoosting())
        {
            lerp = 2.0f;
        }
        thrusterTrail.startSpeed = minSpeed + (maxSpeed - minSpeed) * lerp;
        thrusterTrail.startSize  = minSize + (maxSize - minSize) * lerp;
        thrusterTrail.startColor = initialTrailColor;

        if (motor.IsBoosting())
        {
            thrusterTrail.startColor = boostTrailColor;
        }
    }