UnityEditor.MaterialEditor.RangeProperty C# (CSharp) Method

RangeProperty() public method

public RangeProperty ( MaterialProperty prop, string label ) : float
prop MaterialProperty
label string
return float
        public float RangeProperty(MaterialProperty prop, string label)
        {
            Rect position = this.GetPropertyRect(prop, label, true);
            return this.RangeProperty(position, prop, label);
        }

Same methods

MaterialEditor::RangeProperty ( Rect position, MaterialProperty prop, string label ) : float
MaterialEditor::RangeProperty ( string propertyName, string label, float v2, float v3 ) : float

Usage Example

        public void ShaderPropertiesGUI(Material material)
        {
            // Use default labelWidth
            EditorGUIUtility.labelWidth = 0f;

            // Detect any changes to the material
            EditorGUI.BeginChangeCheck();
            {
                BlendModePopup();

                // Primary properties
                GUILayout.Label(Styles.primaryMapsText, EditorStyles.boldLabel);
                DoAlbedoArea(material);
                DoSpecularMetallicArea();
                m_MaterialEditor.RangeProperty(occlusionStrength, "Occlusion Strength");
                m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null);
                //m_MaterialEditor.TexturePropertySingleLine(Styles.heightMapText, heightMap, heightMap.textureValue != null ? heigtMapScale : null);
                //m_MaterialEditor.TexturePropertySingleLine(Styles.occlusionText, occlusionMap, occlusionMap.textureValue != null ? occlusionStrength : null);
                DoEmissionArea(material);
                //m_MaterialEditor.TexturePropertySingleLine(Styles.detailMaskText, detailMask);
                EditorGUI.BeginChangeCheck();
                m_MaterialEditor.TextureScaleOffsetProperty(albedoMap);
                if (EditorGUI.EndChangeCheck())
                {
                    emissionMap.textureScaleAndOffset = albedoMap.textureScaleAndOffset;             // Apply the main texture scale and offset to the emission texture as well, for Enlighten's sake
                }
                EditorGUILayout.Space();

                // Secondary properties
                //GUILayout.Label(Styles.secondaryMapsText, EditorStyles.boldLabel);
                //m_MaterialEditor.TexturePropertySingleLine(Styles.detailAlbedoText, detailAlbedoMap);
                //m_MaterialEditor.TexturePropertySingleLine(Styles.detailNormalMapText, detailNormalMap, detailNormalMapScale);
                //m_MaterialEditor.TextureScaleOffsetProperty(detailAlbedoMap);
                //m_MaterialEditor.ShaderProperty(uvSetSecondary, Styles.uvSetLabel.text);
            }
            if (EditorGUI.EndChangeCheck())
            {
                foreach (var obj in blendMode.targets)
                {
                    MaterialChanged((Material)obj, m_WorkflowMode);
                }
            }
        }
All Usage Examples Of UnityEditor.MaterialEditor::RangeProperty
MaterialEditor