예제 #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));
 }