public Rect TexturePropertyWithHDRColor(GUIContent label, MaterialProperty textureProp, MaterialProperty colorProperty, ColorPickerHDRConfig hdrConfig, bool showAlpha)
{
ColorPickerHDRConfig defaultHDRConfig;
Rect controlRectForSingleLine = this.GetControlRectForSingleLine();
this.TexturePropertyMiniThumbnail(controlRectForSingleLine, textureProp, label.text, label.tooltip);
if (colorProperty.type != MaterialProperty.PropType.Color)
{
Debug.LogError("Assuming MaterialProperty.PropType.Color (was " + colorProperty.type + ")");
return controlRectForSingleLine;
}
this.BeginAnimatedCheck(colorProperty);
if (hdrConfig != null)
{
defaultHDRConfig = hdrConfig;
}
else
{
defaultHDRConfig = ColorPicker.defaultHDRConfig;
}
Rect leftAlignedFieldRect = GetLeftAlignedFieldRect(controlRectForSingleLine);
EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = colorProperty.hasMixedValue;
Color color = EditorGUI.ColorField(leftAlignedFieldRect, GUIContent.none, colorProperty.colorValue, true, showAlpha, true, defaultHDRConfig);
EditorGUI.showMixedValue = false;
if (EditorGUI.EndChangeCheck())
{
colorProperty.colorValue = color;
}
Rect flexibleRectBetweenFieldAndRightEdge = GetFlexibleRectBetweenFieldAndRightEdge(controlRectForSingleLine);
float labelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = flexibleRectBetweenFieldAndRightEdge.width - EditorGUIUtility.fieldWidth;
EditorGUI.BeginChangeCheck();
color = EditorGUI.ColorBrightnessField(flexibleRectBetweenFieldAndRightEdge, GUIContent.Temp(" "), colorProperty.colorValue, defaultHDRConfig.minBrightness, defaultHDRConfig.maxBrightness);
if (EditorGUI.EndChangeCheck())
{
colorProperty.colorValue = color;
}
EditorGUIUtility.labelWidth = labelWidth;
this.EndAnimatedCheck();
return controlRectForSingleLine;
}