Hide Variables in the Inspector

in my C#-script i use a public bool variable. If this bool variable is true (shown in the Inspector as checked), the object, which the script is attached to, will use a Slerp()-function to change the position. Otherwise it will “jump” to the new position.

This Slerp()-function needs a smoothTime-Variable, which is in my script public, so you can change the value in the Inspector. But you should only be able to change the value of the smoothTime, when the bool variable is checked. So can you gray/fade out or hide the smoothTime-variable when the bool variable is unchecked?

If you do not want the public variable to be in the inspector you can change it to “internal” which makes it still accessible through scripts, but does not show in the inspector.

I am not sure if there is a solution to hide public variables given a bool check, but if there is you should code some Editor stuff to do it.