# HasMatrix

> Checks if the ShaderLab file assigned to the Material has a Matrix property with the given name. This also works with the Matrix Array property.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## HasMatrix(string)

Checks if the ShaderLab file assigned to the Material has a Matrix property with the given name. This also works with the Matrix Array property.

```csharp
public bool HasMatrix(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.

### Returns

| Type                                                          | Description                                                                    |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the ShaderLab file assigned to the Material has this property. |

### Remarks

Additional Resources: [MaterialPropertyBlock](/engine/6000.0/script-reference/unityengine/materialpropertyblock.md), [Material.HasProperty](/engine/6000.0/script-reference/unityengine/material/hasproperty.md), [Material.HasFloat](/engine/6000.0/script-reference/unityengine/material/hasfloat.md), [Material.HasTexture](/engine/6000.0/script-reference/unityengine/material/hastexture.md), [Material.HasBuffer](/engine/6000.0/script-reference/unityengine/material/hasbuffer.md), [Material.HasColor](/engine/6000.0/script-reference/unityengine/material/hascolor.md), [Material.HasConstantBuffer](/engine/6000.0/script-reference/unityengine/material/hasconstantbuffer.md), [Material.HasInt](/engine/6000.0/script-reference/unityengine/material/hasint.md), [Material.HasVector](/engine/6000.0/script-reference/unityengine/material/hasvector.md).

## HasMatrix(int)

Checks if the ShaderLab file assigned to the Material has a Matrix property with the given name. This also works with the Matrix Array property.

```csharp
public bool HasMatrix(int nameID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property. Use [Shader.PropertyToID](/engine/6000.0/script-reference/unityengine/shader/propertytoid.md) to get this ID.

### Returns

| Type                                                          | Description                                                                    |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the ShaderLab file assigned to the Material has this property. |

### Remarks

Additional Resources: [MaterialPropertyBlock](/engine/6000.0/script-reference/unityengine/materialpropertyblock.md), [Material.HasProperty](/engine/6000.0/script-reference/unityengine/material/hasproperty.md), [Material.HasFloat](/engine/6000.0/script-reference/unityengine/material/hasfloat.md), [Material.HasTexture](/engine/6000.0/script-reference/unityengine/material/hastexture.md), [Material.HasBuffer](/engine/6000.0/script-reference/unityengine/material/hasbuffer.md), [Material.HasColor](/engine/6000.0/script-reference/unityengine/material/hascolor.md), [Material.HasConstantBuffer](/engine/6000.0/script-reference/unityengine/material/hasconstantbuffer.md), [Material.HasInt](/engine/6000.0/script-reference/unityengine/material/hasint.md), [Material.HasVector](/engine/6000.0/script-reference/unityengine/material/hasvector.md).
