[Solved] Changing Material Variable by Script?

Hi can someone tell me how to increase and decrease the material variable? I used example script on Unity Docs works fine but goes backwards and forward. I want to only increase and decrease by a certain number. Please advise? Thank you.

    // Update is called once per frame
    void Update () {

        //float waterlevel = Mathf.PingPong(Time.time, 1.0F);
                float waterlevel += 1.0f;
        rend.material.SetFloat("_WaterLevel", waterlevel);

       
    }
}

Example: (Not tested)
float levelInDe = 2.5f;

float waterlevel += levelInDe;

or
if (input.keyboard)
float waterlevel += levelInDe;
else
float waterlevel += standard value;

Thanks but still getting same error as mine.

Unexpected symbol `+=', expecting `,', `;', or `='

normally I increase variables on scripts using += etc but with shaders it seems different?

    float waterlevel;

        waterlevel += 0.01f;
        rend.material.SetFloat("_WaterLevel", waterlevel);