public TexturePropertyTwoLines ( |
||
label | ||
textureProp | ||
extraProperty1 | ||
label2 | ||
extraProperty2 | ||
return |
public Rect TexturePropertyTwoLines(GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, GUIContent label2, MaterialProperty extraProperty2)
{
if (extraProperty2 == null)
{
return this.TexturePropertySingleLine(label, textureProp, extraProperty1);
}
Rect controlRectForSingleLine = this.GetControlRectForSingleLine();
this.TexturePropertyMiniThumbnail(controlRectForSingleLine, textureProp, label.text, label.tooltip);
Rect rectAfterLabelWidth = GetRectAfterLabelWidth(controlRectForSingleLine);
if (extraProperty1.type == MaterialProperty.PropType.Color)
{
rectAfterLabelWidth = GetLeftAlignedFieldRect(controlRectForSingleLine);
}
this.ExtraPropertyAfterTexture(rectAfterLabelWidth, extraProperty1);
Rect position = this.GetControlRectForSingleLine();
this.ShaderProperty(position, extraProperty2, label2.text, 3);
controlRectForSingleLine.height += position.height;
return controlRectForSingleLine;
}
void DoSpecularMetallicArea(Material material) { SpecularMode specularMode = (SpecularMode)material.GetInt("_SpecularMode"); if (specularMode == SpecularMode.BlinnPhong) { if (specularMap.textureValue == null) { m_MaterialEditor.TexturePropertyTwoLines(Styles.specularMapText, specularMap, specularColor, Styles.smoothnessText, smoothness); } else { m_MaterialEditor.TexturePropertySingleLine(Styles.specularMapText, specularMap); m_MaterialEditor.ShaderProperty(reflectanceMin, Styles.reflectanceMinText.text, 2); m_MaterialEditor.ShaderProperty(reflectanceMax, Styles.reflectanceMaxText.text, 2); } } else if (specularMode == SpecularMode.Metallic) { if (metallicMap.textureValue == null) { m_MaterialEditor.TexturePropertyTwoLines(Styles.metallicMapText, metallicMap, metallic, Styles.smoothnessText, smoothness); } else { m_MaterialEditor.TexturePropertySingleLine(Styles.metallicMapText, metallicMap); } } }