Version: Unity 6 Preview (6000.0)
LanguageEnglish
  • C#

MaterialEditor.GetMaterialProperty

Declaration

public static MaterialProperty GetMaterialProperty(Object[] mats, string name);

Declaration

public static MaterialProperty GetMaterialProperty(Object[] mats, int propertyIndex);

Parameters

mats The selected materials.
name Property name.
propertyIndex Property index.

Returns

MaterialProperty Returns the property at the specified index.

Description

Get information about a single shader property.

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

Additional resources: GetMaterialProperties, MaterialProperty.