# IsPropertyLockedByAncestor

> Checks whether a property is locked by any of ancestor of this material.

## Definition

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

## IsPropertyLockedByAncestor(int)

Checks whether a property is locked by any of ancestor of this material.

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

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Property name ID, use [Shader.PropertyToID](/engine/6000.5/script-reference/unityengine/shader/propertytoid.md) to get it.

### Returns

| Type                                                          | Description                                                                                                       |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the property you pass in is locked by any of ancestor of this material. Otherwise, returns false. |

### Remarks

If a property is locked by an ancestor of the material, any change to the property on this Material will not have any effect until the property is unlocked by the ancestor. Note that this method is Editor-only.

Additional Resources: [Material.SetPropertyLock](/engine/6000.5/script-reference/unityengine/material/setpropertylock.md).

## IsPropertyLockedByAncestor(string)

Checks whether a property is locked by any of ancestor of this material.

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

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Property name, e.g. "\_SrcBlend".

### Returns

| Type                                                          | Description                                                                                                       |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if the property you pass in is locked by any of ancestor of this material. Otherwise, returns false. |

### Remarks

If a property is locked by an ancestor of the material, any change to the property on this Material will not have any effect until the property is unlocked by the ancestor. Note that this method is Editor-only.

Additional Resources: [Material.SetPropertyLock](/engine/6000.5/script-reference/unityengine/material/setpropertylock.md).
