Sandbox.Material/FlagsAccessor Flags { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Flags property of the Material class provides access to the flags associated with a material. These flags typically provide hints about the material's contents and are often added procedurally by the shader. However, developers can also add or modify these flags using the material editor.

Usage

To access the flags of a material, you can use the Flags property. This property returns a FlagsAccessor object, which allows you to interact with the material's flags.

Example

// Example of accessing the Flags property of a Material
Material myMaterial = Material.Load("path/to/material");
var flags = myMaterial.Flags;

// Example of checking a specific flag
bool isTransparent = flags.HasFlag(MaterialFlags.Transparent);

// Example of setting a flag
flags.SetFlag(MaterialFlags.Transparent, true);