# GetMaterialProperty

> Get information about a single shader property.

## Definition

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

## GetMaterialProperty(Object\[], string)

Get information about a single shader property.

```csharp
public static MaterialProperty GetMaterialProperty(Object[] mats, string name)
```

### Parameters

**** (\[Object\[]]\(/engine/6000.0/script-reference/unityengine/object)): The selected materials.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Property name.

### Returns

| Type                                                                                | Description                                  |
| ----------------------------------------------------------------------------------- | -------------------------------------------- |
| [MaterialProperty](/engine/6000.0/script-reference/unityeditor/materialproperty.md) | Returns the property at the specified index. |

### Remarks

When implementing custom MaterialEditors, you'd usually pass the `this.targets` array to this function, where `this.targets` is all the selected materials.

Additional Resources: [MaterialEditor.GetMaterialProperties](/engine/6000.0/script-reference/unityeditor/materialeditor/getmaterialproperties.md), [MaterialProperty](/engine/6000.0/script-reference/unityeditor/materialproperty.md).

## GetMaterialProperty(Object\[], int)

Get information about a single shader property.

```csharp
public static MaterialProperty GetMaterialProperty(Object[] mats, int propertyIndex)
```

### Parameters

**** (\[Object\[]]\(/engine/6000.0/script-reference/unityengine/object)): The selected materials.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Property index.

### Returns

| Type                                                                                | Description                                  |
| ----------------------------------------------------------------------------------- | -------------------------------------------- |
| [MaterialProperty](/engine/6000.0/script-reference/unityeditor/materialproperty.md) | Returns the property at the specified index. |

### Remarks

When implementing custom MaterialEditors, you'd usually pass the `this.targets` array to this function, where `this.targets` is all the selected materials.

Additional Resources: [MaterialEditor.GetMaterialProperties](/engine/6000.0/script-reference/unityeditor/materialeditor/getmaterialproperties.md), [MaterialProperty](/engine/6000.0/script-reference/unityeditor/materialproperty.md).
