# PropertyToID(string)

> Gets unique identifier for a shader property name.

## Definition

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

```csharp
public static int PropertyToID(string name)
```

### Parameters

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

### Returns

| Type                                                       | Description                  |
| ---------------------------------------------------------- | ---------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Unique integer for the name. |

### Remarks

Using property identifiers is more efficient than passing strings to all material property functions. For example if you are calling [Material.SetColor](/engine/6000.3/script-reference/unityengine/material/setcolor.md) a lot, or using [MaterialPropertyBlock](/engine/6000.3/script-reference/unityengine/materialpropertyblock.md), then it is better to get the identifiers of the properties you need just once.

Each name of shader property (for example, `_MainTex` or `_Color`) is assigned an unique integer number in Unity, that stays the same for the whole game. The numbers will not be the same between different runs of the game or between machines, so do not store them or send them over network.

Additional Resources: [Material](/engine/6000.3/script-reference/unityengine/material.md), [MaterialPropertyBlock](/engine/6000.3/script-reference/unityengine/materialpropertyblock.md).
