Skip to content

Shader Extensions

Andrzej Kebab edited this page Feb 2, 2024 · 1 revision

Unity Runtime Utility Library

ShaderExtensions

ContainsProperty

Checks if the Shader contains a specific property.

Shader shader = // Your Shader instance;
string propertyName = // Name of the property to check;
bool containsProperty = shader.ContainsProperty(propertyName);

Parameters:

  • shader: The Shader instance.
  • propertyName: The name of the property to check.

Returns:

  • containsProperty: True if the Shader contains the property, false otherwise.

ContainsProperty (Overloaded)

Checks if the Shader contains a specific property of a specific type.

Shader shader = // Your Shader instance;
string propertyName = // Name of the property to check;
ShaderPropertyType propertyType = // Type of the property to check;
bool containsPropertyOfType = shader.ContainsProperty(propertyName, propertyType);

Parameters:

  • shader: The Shader instance.
  • propertyName: The name of the property to check.
  • propertyType: The type of the property to check.

Returns:

  • containsPropertyOfType: True if the Shader contains the property of the specified type, false otherwise.

Clone this wiki locally