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

MaterialEditor.TextureScaleOffsetProperty

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 float TextureScaleOffsetProperty(Rect position, MaterialProperty property);

Parameters

Parameter Description
position The position and size of the control.
property The texture property to draw the fields for.

Returns

float The height, in pixels, that the control uses.

Description

Draws the tiling and offset fields of a texture property, as part of a texture property control.

This overload draws the fields as part of a large texture property control. To draw them separately, use the overload that takes partOfTexturePropertyControl.


Declaration

public float TextureScaleOffsetProperty(Rect position, MaterialProperty property, bool partOfTexturePropertyControl);

Parameters

Parameter Description
position The position and size of the control.
property The texture property to draw the fields for.
partOfTexturePropertyControl Set to true to draw the fields as part of a large texture property control. Set to false to draw them separately.

Returns

float The height, in pixels, that the control uses.

Description

Draws the tiling and offset fields of a texture property, either inside a texture property control or separately.


Declaration

public void TextureScaleOffsetProperty(MaterialProperty property);

Parameters

Parameter Description
property Property to draw.

Description

Draws tiling and offset properties for a texture, using automatic GUI layout.

This is similar to MaterialEditor.TextureScaleOffsetProperty(Rect,MaterialProperty), except the rect is determined automatically.


Declaration

public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset);

Parameters

Parameter Description
position The position and size of the control.
scaleOffset The tiling and offset values, packed into a Vector4 as tiling x, tiling y, offset x, offset y.

Returns

Vector4 The tiling and offset values, which might have changed if the user interacted with the fields.

Description

Draws separate tiling and offset fields for explicit values instead of a material property.

This overload draws the fields separately, not as part of a texture property control. To draw them inside a texture property control, use the overload that takes partOfTexturePropertyControl.


Declaration

public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl);

Parameters

Parameter Description
position The position and size of the control.
scaleOffset The tiling and offset values, packed into a Vector4 as tiling x, tiling y, offset x, offset y.
partOfTexturePropertyControl Set to true to draw the fields as part of a large texture property control. Set to false to draw them separately.

Returns

Vector4 The tiling and offset values, which might have changed if the user interacted with the fields.

Description

Draws tiling and offset fields for explicit values, either inside a texture property control or separately.