Version: 2022.2

MaterialEditor.GetMaterialProperty

切换到手册
public static MaterialProperty GetMaterialProperty (Object[] mats, string name);
public static MaterialProperty GetMaterialProperty (Object[] mats, int propertyIndex);

参数

mats The selected materials.
name 属性名称。
propertyIndex 属性索引。

返回

MaterialProperty Returns the property at the specified index.

描述

获取有关单个着色器属性的信息。

When implementing custom MaterialEditors, you'd usually pass the this.targets array to this function, where this.targets is all the selected materials.

另请参阅:GetMaterialPropertiesMaterialProperty