Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

MaterialEditor.ShaderProperty

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void ShaderProperty(MaterialProperty prop, string label);

Parameters

Parameter Description
prop The material property to draw UI for.
label The label to show for the property.

Description

Draws the UI for a shader property, using automatic layout.

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.


Declaration

public void ShaderProperty(Rect position, MaterialProperty prop, string label);

Parameters

Parameter Description
position The position and size of the control.
prop The material property to draw UI for.
label The label to show for the property.

Description

Draws the UI for a shader property at a specified position.

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 position. To use automatic layout, use the overload without a Rect.


Declaration

public void ShaderProperty(MaterialProperty prop, GUIContent label);

Parameters

Parameter Description
prop The material property to draw UI for.
label The label to show for the property, including any tooltip.

Description

Draws the UI for a shader property with a label and tooltip, using automatic layout.

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.


Declaration

public void ShaderProperty(MaterialProperty prop, string label, int labelIndent);

Parameters

Parameter Description
prop The material property to draw UI for.
label The label to show for the property.
labelIndent The number of levels to indent the label by.

Description

Draws the UI for a shader property with an indented label, using automatic layout.

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.


Declaration

public void ShaderProperty(MaterialProperty prop, GUIContent label, int labelIndent);

Parameters

Parameter Description
prop The material property to draw UI for.
label The label to show for the property, including any tooltip.
labelIndent The number of levels to indent the label by.

Description

Draws the UI for a shader property with an indented label and tooltip, using automatic layout.

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.


Declaration

public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label);

Parameters

Parameter Description
position The position and size of the control.
prop The material property to draw UI for.
label The label to show for the property, including any tooltip.

Description

Draws the UI for a shader property with a label and tooltip, at a specified position.

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 position. To use automatic layout, use the overload without a Rect.


Declaration

public void ShaderProperty(Rect position, MaterialProperty prop, string label, int labelIndent);

Parameters

Parameter Description
position The position and size of the control.
prop The material property to draw UI for.
label The label to show for the property.
labelIndent The number of levels to indent the label by.

Description

Draws the UI for a shader property with an indented label, at a specified position.

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 position. To use automatic layout, use the overload without a Rect.


Declaration

public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label, int labelIndent);

Parameters

Parameter Description
position The position and size of the control.
prop The material property to draw UI for.
label The label to show for the property, including any tooltip.
labelIndent The number of levels to indent the label by.

Description

Draws the UI for a shader property with an indented label and tooltip, at a specified position.

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 position. To use automatic layout, use the overload without a Rect.


Obsolete Use ShaderProperty that takes MaterialProperty parameter instead.

Declaration

public void ShaderProperty(Shader shader, int propertyIndex);

Parameters

Parameter Description
shader The shader that the property belongs to.
propertyIndex The index of the property.

Description

Handles UI for one shader property, specified by property index.

This overload is obsolete. Use MaterialEditor.ShaderProperty(MaterialProperty,string) instead.