Class MaterialEditorExtension
Set of extensions to allow storing, getting and setting the expandable states of a MaterialEditor areas
Namespace: UnityEditor.Rendering
Syntax
public static class MaterialEditorExtension
Methods
IntPopupShaderProperty(MaterialEditor, MaterialProperty, String, String[], Int32[])
Draw an integer popup selection field for a float shader property.
Declaration
public static int IntPopupShaderProperty(this MaterialEditor editor, MaterialProperty prop, string label, string[] displayedOptions, int[] optionValues)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| String | label | Label for the property  | 
| String[] | displayedOptions | An array with the options shown in the popup  | 
| Int32[] | optionValues | An array with the values for each option  | 
Returns
| Type | Description | 
|---|---|
| Int32 | The value of the option that has been selected by the user  | 
IntShaderProperty(MaterialEditor, MaterialProperty, GUIContent, Func<Int32, Int32>)
Draw an integer property field for a float shader property.
Declaration
public static void IntShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, Func<int, int> transform = null)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| GUIContent | label | Label for the property  | 
| Func<Int32, Int32> | transform | Optional function to apply on the new value  | 
IntSliderShaderProperty(MaterialEditor, MaterialProperty, Int32, Int32, GUIContent)
Draw an integer slider for a float shader property.
Declaration
public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialProperty prop, int min, int max, GUIContent label)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| Int32 | min | The value at the left end of the slider  | 
| Int32 | max | The value at the right end of the slider  | 
| GUIContent | label | Label for the property  | 
IntSliderShaderProperty(MaterialEditor, MaterialProperty, GUIContent)
Draw an integer slider for a range shader property.
Declaration
public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| GUIContent | label | Label for the property  | 
MinFloatShaderProperty(MaterialEditor, MaterialProperty, GUIContent, Single)
Draw a property field for a float shader property.
Declaration
public static void MinFloatShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, float min)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| GUIContent | label | Label for the property  | 
| Single | min | The minimum value the user can specify  | 
MinMaxShaderProperty(MaterialEditor, MaterialProperty, Single, Single, GUIContent)
Draw a special slider to specify a range between a min and a max for a vector shader property.
Declaration
public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProperty remapProp, float minLimit, float maxLimit, GUIContent label)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | remapProp | The MaterialProperty containing the range the slider shows in the x and y components of its vectorValue  | 
| Single | minLimit | The limit at the left end of the slider  | 
| Single | maxLimit | The limit at the right end of the slider  | 
| GUIContent | label | Label for the property  | 
MinMaxShaderProperty(MaterialEditor, MaterialProperty, MaterialProperty, Single, Single, GUIContent)
Draw a special slider to specify a range between a min and a max for two float shader properties.
Declaration
public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProperty min, MaterialProperty max, float minLimit, float maxLimit, GUIContent label)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | min | The MaterialProperty containing the lower value of the range the slider shows  | 
| MaterialProperty | max | The MaterialProperty containing the upper value of the range the slider shows  | 
| Single | minLimit | The limit at the left end of the slider  | 
| Single | maxLimit | The limit at the right end of the slider  | 
| GUIContent | label | Label for the property  | 
PopupShaderProperty(MaterialEditor, MaterialProperty, GUIContent, String[])
Draw a popup selection field for a float shader property.
Declaration
public static int PopupShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, string[] displayedOptions)
Parameters
| Type | Name | Description | 
|---|---|---|
| MaterialEditor | editor | MaterialEditor | 
| MaterialProperty | prop | The MaterialProperty to make a field for  | 
| GUIContent | label | Label for the property  | 
| String[] | displayedOptions | An array with the options shown in the popup  | 
Returns
| Type | Description | 
|---|---|
| Int32 | The index of the option that has been selected by the user  |