Animating a switch on and off

Hi
I have a switch in a shader which works when I use it in the inspector but if I try to animate it (using 0 for off and 1 for on) then it doesn't work, am I doing something wrong?
I'm using the Unity animator and keyframing the states.
Thanks
I have a switch in a shader which works when I use it in the inspector but if I try to animate it (using 0 for off and 1 for on) then it doesn't work, am I doing something wrong?
I'm using the Unity animator and keyframing the states.
Thanks