Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetMaterialProperty

Get information about a single shader property.
Read time 1 minuteLast updated 6 days ago

Definition

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

GetMaterialProperty(Object[], string)

Get information about a single shader property.
public static MaterialProperty GetMaterialProperty(Object[] mats, string name)

Parameters

The selected materials.

name

Property name.

Returns

Type

Description

MaterialPropertyReturns the property at the specified index.

Remarks

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

GetMaterialProperty(Object[], int)

Get information about a single shader property.
public static MaterialProperty GetMaterialProperty(Object[] mats, int propertyIndex)

Parameters

The selected materials.

propertyIndex

Property index.

Returns

Type

Description

MaterialPropertyReturns the property at the specified index.

Remarks

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