Esempio n. 1
0
 /// <summary>
 /// Point between Min and Max
 /// </summary>
 public static float MidPoint(this MinMaxFloat minMax)
 {
     return(minMax.min + minMax.Length() / 2f);
 }
Esempio n. 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));
 }
Esempio n. 3
0
 /// <summary>
 /// Distance from Min to Max
 /// </summary>
 public static float Length(this MinMaxFloat minMax)
 {
     return(minMax.max - minMax.min);
 }
Esempio n. 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));
 }
Esempio n. 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);
 }
Esempio n. 6
0
 /// <summary>
 /// Lerp from Min to Max
 /// </summary>
 public static float RandomInRange(this MinMaxFloat minMax)
 {
     return(Random.Range(minMax.Min, minMax.Max));
 }
Esempio n. 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));
 }