ShaderProperty
Draws the UI for a shader property, using automatic layout.
Read time 5 minutesLast updated 20 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
ShaderProperty(MaterialProperty, string)
Draws the UI for a shader property, using automatic layout.
public void ShaderProperty(MaterialProperty prop, string label)
Parameters
The material property to draw UI for.
The label to show for the property.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.
ShaderProperty(MaterialProperty, GUIContent)
Draws the UI for a shader property with a label and tooltip, using automatic layout.
public void ShaderProperty(MaterialProperty prop, GUIContent label)
Parameters
The material property to draw UI for.
The label to show for the property, including any tooltip.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.
ShaderProperty(MaterialProperty, string, int)
Draws the UI for a shader property with an indented label, using automatic layout.
public void ShaderProperty(MaterialProperty prop, string label, int labelIndent)
Parameters
The material property to draw UI for.
The label to show for the property.
The number of levels to indent the label by.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.
ShaderProperty(MaterialProperty, GUIContent, int)
Draws the UI for a shader property with an indented label and tooltip, using automatic layout.
public void ShaderProperty(MaterialProperty prop, GUIContent label, int labelIndent)
Parameters
The material property to draw UI for.
The label to show for the property, including any tooltip.
The number of levels to indent the label by.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.
ShaderProperty(Rect, MaterialProperty, string)
Draws the UI for a shader property at a specified position.
public void ShaderProperty(Rect position, MaterialProperty prop, string label)
Parameters
The position and size of the control.
The material property to draw UI for.
The label to show for the property.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload draws the control at . To use automatic layout, use the overload without a Rect.
positionShaderProperty(Rect, MaterialProperty, GUIContent)
Draws the UI for a shader property with a label and tooltip, at a specified position.
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label)
Parameters
The position and size of the control.
The material property to draw UI for.
The label to show for the property, including any tooltip.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload draws the control at . To use automatic layout, use the overload without a Rect.
positionShaderProperty(Rect, MaterialProperty, string, int)
Draws the UI for a shader property with an indented label, at a specified position.
public void ShaderProperty(Rect position, MaterialProperty prop, string label, int labelIndent)
Parameters
The position and size of the control.
The material property to draw UI for.
The label to show for the property.
The number of levels to indent the label by.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload draws the control at . To use automatic layout, use the overload without a Rect.
positionShaderProperty(Rect, MaterialProperty, GUIContent, int)
Draws the UI for a shader property with an indented label and tooltip, at a specified position.
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label, int labelIndent)
Parameters
The position and size of the control.
The material property to draw UI for.
The label to show for the property, including any tooltip.
The number of levels to indent the label by.
Remarks
This method draws the appropriate UI for the type of the shader property. It applies any custom MaterialPropertyDrawer that the shader defines for the property. To draw the default UI without custom drawers, use MaterialEditor.DefaultShaderProperty. This overload draws the control at . To use automatic layout, use the overload without a Rect.
positionShaderProperty(Shader, int)
Handles UI for one shader property, specified by property index.
public void ShaderProperty(Shader shader, int propertyIndex)
Parameters
Remarks
This overload is obsolete. Use MaterialEditor.ShaderProperty(MaterialProperty, string) instead.