ColorProperty
Draws a field for a color shader property, using automatic layout.
Read time 1 minuteLast updated 20 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
ColorProperty(MaterialProperty, string)
Draws a field for a color shader property, using automatic layout.
public Color ColorProperty(MaterialProperty prop, string label)
Parameters
Returns
Type | Description |
|---|---|
| Color | The value of the property, which might have changed if the user interacted with the control. |
Remarks
Use this method in a custom material editor to draw a field for a color shader property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.
ColorProperty(Rect, MaterialProperty, string)
Draws a field for a color shader property at a specified position.
public Color ColorProperty(Rect position, MaterialProperty prop, string label)
Parameters
The position and size of the control.
The material property to edit.
The label to show for the property.
Returns
Type | Description |
|---|---|
| Color | The value of the property, which might have changed if the user interacted with the control. |
Remarks
Use this method in a custom material editor to draw a field for a color shader property. This overload draws the control at . To use automatic layout, use the overload without a Rect.
positionColorProperty(string, string)
Draw a property field for a color shader property, specified by name.
public Color ColorProperty(string propertyName, string label)
Parameters
Returns
Type | Description |
|---|---|
| Color | The value of the property, which might have been changed by the user interacting with the control. |
Remarks
This overload is obsolete. Use MaterialEditor.ColorProperty(MaterialProperty, string) instead.