Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetPropertyLock

Sets the lock state of a property for this material.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

SetPropertyLock(int, bool)

Sets the lock state of a property for this material.
public void SetPropertyLock(int nameID, bool value)

Parameters

nameID

Property name ID, use Shader.PropertyToID to get it.

value

The desired lock state.

Remarks

If a property is locked by the material, any Material Variant inheriting from this Material will be unable to change the value of the property. Note that this method is Editor-only.
Additional Resources: GetPropertyLock, Material.IsPropertyLockedByAncestor.

SetPropertyLock(string, bool)

Sets the lock state of a property for this material.
public void SetPropertyLock(string name, bool value)

Parameters

name

Property name, e.g. "_SrcBlend".

value

The desired lock state.

Remarks

If a property is locked by the material, any Material Variant inheriting from this Material will be unable to change the value of the property. Note that this method is Editor-only.
Additional Resources: GetPropertyLock, Material.IsPropertyLockedByAncestor.