# HasProperty

> Checks if the ShaderLab file assigned to the Material has a property with the given name.

## Definition

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

## HasProperty(int)

Checks if the ShaderLab file assigned to the Material has a property with the given name.

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

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property. Use [Shader.PropertyToID](/engine/6000.5/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: [Materials](/engine/6000.5/manual/materials-and-shaders/materials.md), [ShaderLab documentation](/engine/6000.5/script-reference/unityengine/shaders.md), [Material.HasFloat](/engine/6000.5/script-reference/unityengine/material/hasfloat.md), [Material.HasTexture](/engine/6000.5/script-reference/unityengine/material/hastexture.md), [Material.HasBuffer](/engine/6000.5/script-reference/unityengine/material/hasbuffer.md), [Material.HasColor](/engine/6000.5/script-reference/unityengine/material/hascolor.md), [Material.HasConstantBuffer](/engine/6000.5/script-reference/unityengine/material/hasconstantbuffer.md), [Material.HasInt](/engine/6000.5/script-reference/unityengine/material/hasint.md), [Material.HasMatrix](/engine/6000.5/script-reference/unityengine/material/hasmatrix.md), [Material.HasVector](/engine/6000.5/script-reference/unityengine/material/hasvector.md).

## HasProperty(string)

Checks if the ShaderLab file assigned to the Material has a property with the given name.

```csharp
public bool HasProperty(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: [Materials](/engine/6000.5/manual/materials-and-shaders/materials.md), [ShaderLab documentation](/engine/6000.5/script-reference/unityengine/shaders.md), [Material.HasFloat](/engine/6000.5/script-reference/unityengine/material/hasfloat.md), [Material.HasTexture](/engine/6000.5/script-reference/unityengine/material/hastexture.md), [Material.HasBuffer](/engine/6000.5/script-reference/unityengine/material/hasbuffer.md), [Material.HasColor](/engine/6000.5/script-reference/unityengine/material/hascolor.md), [Material.HasConstantBuffer](/engine/6000.5/script-reference/unityengine/material/hasconstantbuffer.md), [Material.HasInt](/engine/6000.5/script-reference/unityengine/material/hasint.md), [Material.HasMatrix](/engine/6000.5/script-reference/unityengine/material/hasmatrix.md), [Material.HasVector](/engine/6000.5/script-reference/unityengine/material/hasvector.md).
