UnityEditor.MaterialEditor.TexturePropertyTwoLines C# (CSharp) Method

TexturePropertyTwoLines() public method

public TexturePropertyTwoLines ( GUIContent label, MaterialProperty textureProp, MaterialProperty extraProperty1, GUIContent label2, MaterialProperty extraProperty2 ) : Rect
label UnityEngine.GUIContent
textureProp MaterialProperty
extraProperty1 MaterialProperty
label2 UnityEngine.GUIContent
extraProperty2 MaterialProperty
return UnityEngine.Rect
        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;
        }

Usage Example

        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);
                }
            }
        }
All Usage Examples Of UnityEditor.MaterialEditor::TexturePropertyTwoLines
MaterialEditor