/// <summary> /// Distance from Min to Max /// </summary> public static int Length(this MinMaxInt minMax) { return(minMax.Max - minMax.Min); }
/// <summary> /// Point between Min and Max /// </summary> public static int MidPoint(this MinMaxInt minMax) { return(minMax.Min + minMax.Length() / 2); }
/// <summary> /// Clamp value between MinMax values /// </summary> public static int Clamp(this MinMaxInt minMax, int value) { return(Mathf.Clamp(value, minMax.Min, minMax.Max)); }