Пример #1
0
 /// <summary>
 /// Point between Min and Max
 /// </summary>
 public static float MidPoint(this MinMaxFloat minMax)
 {
     return(minMax.min + minMax.Length() / 2f);
 }
Пример #2
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));
 }
Пример #3
0
 /// <summary>
 /// Distance from Min to Max
 /// </summary>
 public static float Length(this MinMaxFloat minMax)
 {
     return(minMax.max - minMax.min);
 }
Пример #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));
 }
Пример #5
0
 /// <summary>
 /// Value is in range of min and max
 /// </summary>
 public static bool IsInRange(this MinMaxFloat minMax, float value)
 {
     return(value >= minMax.Min && value <= minMax.Max);
 }
Пример #6
0
 /// <summary>
 /// Lerp from Min to Max
 /// </summary>
 public static float RandomInRange(this MinMaxFloat minMax)
 {
     return(Random.Range(minMax.Min, minMax.Max));
 }
Пример #7
0
 /// <summary>
 /// Lerp from Min to Max
 /// </summary>
 public static float Lerp(this MinMaxFloat minMax, float value)
 {
     return(Mathf.Lerp(minMax.Min, minMax.Max, value));
 }