Skip to content

Format

typescript
Material.IsKeywordEnabled(value)

class: Material

Description

Checks if the specified shader keyword is enabled for this material.

Shader keywords are preprocessor directives used in shaders to enable or disable specific features. This method can be used to check if a material has a specific keyword enabled, and adjust the material's rendering logic based on the enabled state of the keyword.

Parameters

param_nametypedescription
valuestringThe shader keyword.

Return

typedescription
booleanTrue if the specified shader keyword is enabled; otherwise, false.

Code Example

typescript
let material = Resources.Load<Material>(Material, "materialId");
material.IsKeywordEnabled("keyword");