GameObjectFlags Flags { get; set; }

robot_2Generated
code_blocksInput

Description

The Flags property of a GameObject in the Sandbox framework represents various state flags that can be associated with the GameObject. These flags are used to define specific behaviors or characteristics of the GameObject within the scene.

Usage

Use the Flags property to get or set the state flags of a GameObject. This property is useful for managing and querying the state of a GameObject in a more granular way.

Example

// Example of setting and getting the Flags property of a GameObject

// Assume 'gameObject' is an instance of GameObject
Sandbox.GameObject gameObject = new Sandbox.GameObject();

// Set flags
gameObject.Flags = Sandbox.GameObjectFlags.SomeFlag;

// Get flags
Sandbox.GameObjectFlags currentFlags = gameObject.Flags;

// Check if a specific flag is set
bool isFlagSet = (currentFlags & Sandbox.GameObjectFlags.SomeFlag) != 0;