How to get a value between 0 and 1 that I know the input value, minimum and maximum values;
For Example How Do this function:
float needValue = GetBetweenValue(min,max,inputValue);
public float GetBetweenValue(float min,float max, float inputValue) {
…
return 0.0f or 1.0f depending on how the value is close to the min and max;
}
Loius
3
(inputValue-min)/(max-min)
What about using Mathf.Round?
float needValue = Mathf.Round(inputValue);