Пример #1
0
 /// <summary>
 /// Lerp from Min to Max
 /// </summary>
 public static float LerpUnclamped(this MinMaxFloat minMax, float value)
 {
     return(Mathf.LerpUnclamped(minMax.Min, minMax.Max, value));
 }
Пример #2
0
 /// <summary>
 /// Distance from Min to Max
 /// </summary>
 public static float Length(this MinMaxFloat minMax)
 {
     return(minMax.Max - minMax.Min);
 }
Пример #3
0
 /// <summary>
 /// Point between Min and Max
 /// </summary>
 public static float MidPoint(this MinMaxFloat minMax)
 {
     return(minMax.Min + minMax.Length() / 2f);
 }
Пример #4
0
 /// <summary>
 /// Clamp value between MinMax values
 /// </summary>
 public static float Clamp(this MinMaxFloat minMax, float value)
 {
     return(Mathf.Clamp(value, minMax.Min, minMax.Max));
 }