Version: 2022.2

Material.SetPropertyLock

切换到手册
public void SetPropertyLock (string name, bool value);
public void SetPropertyLock (int nameID, bool value);

参数

nameID 属性名称 ID,使用 Shader.PropertyToID 获取。
name 属性名称,例如“_SrcBlend”。
value The desired lock state.

描述

Sets the lock state of a property for this material.

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.

See Also: Material.GetPropertyLock, Material.IsPropertyLockedByAncestor.