/// <summary> /// Point between Min and Max /// </summary> public static float MidPoint(this MinMaxFloat minMax) { return(minMax.min + minMax.Length() / 2f); }
/// <summary> /// Lerp from Min to Max /// </summary> public static float LerpUnclamped(this MinMaxFloat minMax, float value) { return(Mathf.LerpUnclamped(minMax.min, minMax.max, value)); }
/// <summary> /// Distance from Min to Max /// </summary> public static float Length(this MinMaxFloat minMax) { return(minMax.max - minMax.min); }
/// <summary> /// Clamp value between MinMax values /// </summary> public static float Clamp(this MinMaxFloat minMax, float value) { return(Mathf.Clamp(value, minMax.min, minMax.max)); }
/// <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); }
/// <summary> /// Lerp from Min to Max /// </summary> public static float RandomInRange(this MinMaxFloat minMax) { return(Random.Range(minMax.Min, minMax.Max)); }
/// <summary> /// Lerp from Min to Max /// </summary> public static float Lerp(this MinMaxFloat minMax, float value) { return(Mathf.Lerp(minMax.Min, minMax.Max, value)); }