# ShaderProperty

> Handes UI for one shader property.

## Definition

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

## ShaderProperty(MaterialProperty, string)

Handes UI for one shader property.

```csharp
public void ShaderProperty(MaterialProperty prop, string label)
```

### Parameters

**** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(MaterialProperty, GUIContent)

Handes UI for one shader property.

```csharp
public void ShaderProperty(MaterialProperty prop, GUIContent label)
```

### Parameters

**** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(MaterialProperty, string, int)

Handes UI for one shader property.

```csharp
public void ShaderProperty(MaterialProperty prop, string label, int labelIndent)
```

### Parameters

**** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(MaterialProperty, GUIContent, int)

Handes UI for one shader property.

```csharp
public void ShaderProperty(MaterialProperty prop, GUIContent label, int labelIndent)
```

### Parameters

**** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(Rect, MaterialProperty, string)

Handes UI for one shader property.

```csharp
public void ShaderProperty(Rect position, MaterialProperty prop, string label)
```

### Parameters

**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): **** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(Rect, MaterialProperty, GUIContent)

Handes UI for one shader property.

```csharp
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label)
```

### Parameters

**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): **** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(Rect, MaterialProperty, string, int)

Handes UI for one shader property.

```csharp
public void ShaderProperty(Rect position, MaterialProperty prop, string label, int labelIndent)
```

### Parameters

**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): **** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(Rect, MaterialProperty, GUIContent, int)

Handes UI for one shader property.

```csharp
public void ShaderProperty(Rect position, MaterialProperty prop, GUIContent label, int labelIndent)
```

### Parameters

**** (\[Rect]\(/engine/6000.7/script-reference/unityengine/rect)): **** (\[MaterialProperty]\(/engine/6000.7/script-reference/unityeditor/materialproperty)): **** (\[GUIContent]\(/engine/6000.7/script-reference/unityengine/guicontent)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).

## ShaderProperty(Shader, int)

Handes UI for one shader property.

> **Warning:**
>
> **Deprecated.** Use ShaderProperty that takes MaterialProperty parameter instead.

```csharp
public void ShaderProperty(Shader shader, int propertyIndex)
```

### Parameters

**** (\[Shader]\(/engine/6000.7/script-reference/unityengine/shader)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Remarks

This function will draw appropriate UI for the given shader property, depending on its type.

Any custom [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md) objects defined for this property in the shader will also be applied. If you want to draw the "default" UI without any custom drawers, use [MaterialEditor.DefaultShaderProperty](/engine/6000.7/script-reference/unityeditor/materialeditor/defaultshaderproperty.md) function.

Additional Resources: [MaterialProperty](/engine/6000.7/script-reference/unityeditor/materialproperty.md), [MaterialPropertyDrawer](/engine/6000.7/script-reference/unityeditor/materialpropertydrawer.md).
