# TextureProperty

> Draws a field for a texture shader property, using automatic layout.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/7000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## TextureProperty(MaterialProperty, string)

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

```csharp
public Texture TextureProperty(MaterialProperty prop, string label)
```

### Parameters

**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show for the property.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload shows the tiling and offset fields unless the shader property has the `[NoScaleOffset]` attribute. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(MaterialProperty, string, bool)

Draws a field for a texture shader property, with or without tiling and offset fields, using automatic layout.

```csharp
public Texture TextureProperty(MaterialProperty prop, string label, bool scaleOffset)
```

### Parameters

**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show for the property.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true to show the tiling and offset fields. Set to false to hide them.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(Rect, MaterialProperty, string)

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

```csharp
public Texture TextureProperty(Rect position, MaterialProperty prop, string label)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): The position and size of the control.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show for the property.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload shows the tiling and offset fields unless the shader property has the `[NoScaleOffset]` attribute. This overload draws the control at `position`. To use automatic layout, use the overload without a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(Rect, MaterialProperty, GUIContent)

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

```csharp
public Texture TextureProperty(Rect position, MaterialProperty prop, GUIContent label)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): The position and size of the control.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[GUIContent]\(/engine/7000.0/script-reference/unityengine/guicontent)): The label to show for the property, including any tooltip.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload shows the tiling and offset fields unless the shader property has the `[NoScaleOffset]` attribute. This overload draws the control at `position`. To use automatic layout, use the overload without a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(Rect, MaterialProperty, string, bool)

Draws a field for a texture shader property at a specified position, with or without tiling and offset fields.

```csharp
public Texture TextureProperty(Rect position, MaterialProperty prop, string label, bool scaleOffset)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): The position and size of the control.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show for the property.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true to show the tiling and offset fields. Set to false to hide them.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload draws the control at `position`. To use automatic layout, use the overload without a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(Rect, MaterialProperty, string, string, bool)

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

```csharp
public Texture TextureProperty(Rect position, MaterialProperty prop, string label, string tooltip, bool scaleOffset)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): The position and size of the control.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to show for the property.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The tooltip to show for the property.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true to show the tiling and offset fields. Set to false to hide them.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload draws the control at `position`. To use automatic layout, use the overload without a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(Rect, MaterialProperty, GUIContent, bool)

Draws a field for a texture shader property with a label and tooltip, at a specified position, with or without tiling and offset fields.

```csharp
public Texture TextureProperty(Rect position, MaterialProperty prop, GUIContent label, bool scaleOffset)
```

### Parameters

**** (\[Rect]\(/engine/7000.0/script-reference/unityengine/rect)): The position and size of the control.**** (\[MaterialProperty]\(/engine/7000.0/script-reference/unityeditor/materialproperty)): The material property to edit.**** (\[GUIContent]\(/engine/7000.0/script-reference/unityengine/guicontent)): The label to show for the property, including any tooltip.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true to show the tiling and offset fields. Set to false to hide them.

### Returns

| Type                                                              | Description                                                                                             |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to 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 texture shader property. This overload draws the control at `position`. To use automatic layout, use the overload without a [Rect](/engine/7000.0/script-reference/unityengine/rect.md).

## TextureProperty(string, string, ShaderPropertyTexDim)

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

> **Warning:**
>
> **Removed.** Use TextureProperty with MaterialProperty instead.

```csharp
public Texture TextureProperty(string propertyName, string label, ShaderUtil.ShaderPropertyTexDim texDim)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the shader property.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label for the field.**** (ShaderPropertyTexDim): This parameter isn't used.

### Returns

| Type                                                              | Description                                                                                                   |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to the property, which might have been changed by the user interacting with the control. |

### Remarks

This overload is obsolete. Use [MaterialEditor.TextureProperty(MaterialProperty, string)](/engine/7000.0/script-reference/unityeditor/materialeditor/textureproperty.md#textureproperty\(materialproperty-string\)) instead.

## TextureProperty(string, string, ShaderPropertyTexDim, bool)

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

> **Warning:**
>
> **Removed.** Use TextureProperty with MaterialProperty instead.

```csharp
public Texture TextureProperty(string propertyName, string label, ShaderUtil.ShaderPropertyTexDim texDim, bool scaleOffset)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the shader property.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Label for the field.**** (ShaderPropertyTexDim): This parameter isn't used.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Draw scale / offset.

### Returns

| Type                                                              | Description                                                                                                   |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/7000.0/script-reference/unityengine/texture.md) | The texture assigned to the property, which might have been changed by the user interacting with the control. |

### Remarks

This overload is obsolete. Use [MaterialEditor.TextureProperty(MaterialProperty, string, bool)](/engine/7000.0/script-reference/unityeditor/materialeditor/textureproperty.md#textureproperty\(materialproperty-string-bool\)) instead.
