i wanna add to here gearboxsliderr

its must show values from 1-0.3

1 its max speed

0.3 its min speed

its switching by gears - keycodes and button calling that - its increasde or dicrease in clamp
i mean i need somehow divide and get values from 0.3 - 1 like availabel min and max speed switching like for example 3 - 15 speed

there is scriptt

answerr short, i need only vaaibles and voids





using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine;
using EndlessCarChase;


public class ECC : MonoBehaviour
{
    [Tooltip("The speed of the player, how fast it moves player.The player moves forward constantly")]
    public float originalspeed = 15f;
    public ECCCar ecc;

    [Tooltip("The minimum speed of the player")]
    public float minSpeed = 3f;

    [Tooltip("The default speed of the player")]
    public float defaultSpeed = 15f;

    [Tooltip("The multiplier for nitro effect")]
    public float nitroMultiplier = 1.5f;

    public float currentSpeed;
    [Header("UI Buttons")]
    public Button increaseSpeedButton;
    public Button decreaseSpeedButton;
    public Button nitroButton;
    public TMPro.TextMeshPro speed;
    public TMPro.TextMeshPro nitro;
    public TMPro.TextMeshPro alert;
    public bool yecoc;

    public void StartEnable(ECCCar eccCache)
    {yecoc=true;
        StartECC(eccCache);//Invoke("StartECC", 0.03f);
    }    private void StartECC(ECCCar eccCache)
    {ecc= eccCache;
         // Initialize currentSpeed to default speed
         originalspeed = ecc.speed;      // Subscribe to button click events
        currentSpeed = originalspeed;      // Subscribe to button click events
        if (increaseSpeedButton != null)
        {
            increaseSpeedButton.onClick.AddListener(() => ChangeSpeed(true));
        }
        if (decreaseSpeedButton != null)
        {
            decreaseSpeedButton.onClick.AddListener(() => ChangeSpeed(false));
        }
        if (nitroButton != null)
        {
            nitroButton.onClick.AddListener(ActivateNitroButton);
        }
    }

    private void Update()
    {if(!ecc.local)return;
        
        ecc.speed= currentSpeed;
        HandleSpeedControl();
        MovePlayer();
    }

    private void HandleSpeedControl()
    {
        // Speed up with key “1” or button press (example: UI button)
        if (Input.GetKeyDown(KeyCode.W)) // KeyCode for number 1 on keyboard
        {
            ChangeSpeed(true);
        }

        // Slow down with key “2” or button press (example: UI button)
        if (Input.GetKeyDown(KeyCode.S)) // KeyCode for number 2 on keyboard
        {
            ChangeSpeed(false);
        }

        // Activate nitro with key “N” or button press (example: UI button)
        if (Input.GetKey(KeyCode.Space)) // KeyCode for “N” key on keyboard
        {
            ActivateNitro();
        }
        else
        {
        }
    }

    private void ChangeSpeed(bool increase)
    {
        if (increase)
        {
            currentSpeed++;
        }
        else
        {
            currentSpeed--;
        }

        // Clamp speed to be no less than minSpeed
        currentSpeed = Mathf.Clamp(currentSpeed, minSpeed, originalspeed*nitroMultiplier);
    }

    private void ActivateNitro()
    {
        currentSpeed = defaultSpeed * nitroMultiplier;        Invoke("ResetSpeed", 3.0f);
    }
    private void ActivateNitroButton()
    {
        ActivateNitro();

        // Optional: Set a timer to reset the speed after some seconds (e.g., 3 seconds)
        Invoke("ResetSpeed", 3.0f);
    }
    private void ResetSpeed()
    {
        currentSpeed = originalspeed;
    }



    private void MovePlayer()
    {
        // Example of forward movement with the adjusted speed
        transform.Translate(Vector3.forward * currentSpeed * Time.deltaTime);
    }
}