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

MaterialEditor.VectorProperty

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 Vector4 VectorProperty(MaterialProperty prop, string label);

Parameters

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

Returns

Vector4 The value of the property, which might have changed if the user interacted with the control.

Description

Draws a field for a vector shader property, using automatic layout.

Use this method in a custom material editor to draw a field for a vector shader property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.


Declaration

public Vector4 VectorProperty(MaterialProperty prop, GUIContent label);

Parameters

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

Returns

Vector4 The value of the property, which might have changed if the user interacted with the control.

Description

Draws a field for a vector shader property with a label and tooltip, using automatic layout.

Use this method in a custom material editor to draw a field for a vector shader property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.


Declaration

public Vector4 VectorProperty(Rect position, MaterialProperty prop, string label);

Parameters

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

Returns

Vector4 The value of the property, which might have changed if the user interacted with the control.

Description

Draws a field for a vector shader property at a specified position.

Use this method in a custom material editor to draw a field for a vector shader property. This overload draws the control at position. To use automatic layout, use the overload without a Rect.


Declaration

public Vector4 VectorProperty(Rect position, MaterialProperty prop, GUIContent label);

Parameters

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

Returns

Vector4 The value of the property, which might have changed if the user interacted with the control.

Description

Draws a field for a vector shader property with a label and tooltip, at a specified position.

Use this method in a custom material editor to draw a field for a vector shader property. This overload draws the control at position. To use automatic layout, use the overload without a Rect.


Obsolete Use VectorProperty with MaterialProperty instead.

Declaration

public Vector4 VectorProperty(string propertyName, string label);

Parameters

Parameter Description
propertyName The name of the shader property.
label Label for the field.

Returns

Vector4 The value of the property, which might have been changed by the user interacting with the control.

Description

Draw a property field for a vector shader property, specified by name.

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