Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


FindPropertyIndex(string)

Finds the index of a shader property by its name.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public int FindPropertyIndex(string propertyName)

Parameters

propertyName

The name of the shader property.

Returns

Type

Description

int

Remarks

You can use the index with functions such as Shader.GetPropertyType and Shader.GetPropertyFlags to get more detailed property information. If Unity cannot find a property with the given name, the function returns -1.