文档

Unity Engine

Unity Engine

DefaultShaderProperty

Draws the default UI for a shader property, ignoring any custom drawers, using automatic layout.
阅读时间1 分钟最后更新于 21 天前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

DefaultShaderProperty(MaterialProperty, string)

Draws the default UI for a shader property, ignoring any custom drawers, using automatic layout.
public void DefaultShaderProperty(MaterialProperty prop, string label)

Parameters

The material property to draw UI for.

label

The label to show for the property.

Remarks

This method is similar to MaterialEditor.ShaderProperty, except it ignores any custom MaterialPropertyDrawer that the shader defines for the property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.

DefaultShaderProperty(Rect, MaterialProperty, string)

Draws the default UI for a shader property, ignoring any custom drawers, at a specified position.
public void DefaultShaderProperty(Rect position, MaterialProperty prop, string label)

Parameters

position

The position and size of the control.

The material property to draw UI for.

label

The label to show for the property.

Remarks

This method is similar to MaterialEditor.ShaderProperty, except it ignores any custom MaterialPropertyDrawer that the shader defines for the property. This overload draws the control at
position
. To use automatic layout, use the overload without a Rect.