文档

Unity Engine

Unity Engine

FindProperty

Find shader properties.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

FindProperty(string, MaterialProperty[])

Find shader properties.
protected static MaterialProperty FindProperty(string propertyName, MaterialProperty[] properties)

Parameters

propertyName

The name of the material property.

The array of available material properties.

Returns

Type

Description

MaterialPropertyThe material property found, otherwise null.

Remarks

This is a utility method that finds a MaterialProperty by name.

FindProperty(string, MaterialProperty[], bool)

Find shader properties.
protected static MaterialProperty FindProperty(string propertyName, MaterialProperty[] properties, bool propertyIsMandatory)

Parameters

propertyName

The name of the material property.

The array of available material properties.

propertyIsMandatory

If true then this method will throw an exception if a property with propertyName was not found.

Returns

Type

Description

MaterialPropertyThe material property found, otherwise null.

Remarks

This is a utility method that finds a MaterialProperty by name.