📜  unity normalize float - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.710000             🧑  作者: Mango

代码示例1
//Calculate the normalized float;     
normalizedFloat = (i - min) / (max - min);
//Clamp the "i" float between "min" value and "max" value
i = Mathf.Clamp(i, min, max);
//Clamp the normalized float between 0 and 1
normalizedFloat = Mathf.Clamp(normalizedFloat, 0, 1);