public static float ClampMax(this float value, float max) { if (value > max) { return max; } return value; }