Description
The Flags
property of a GameObject
in the Sandbox framework represents various state flags associated with the GameObject
. These flags can be used to determine or modify the behavior of the GameObject
within the scene. The property is of type GameObjectFlags
, which is an enumeration that defines different possible states or characteristics that a GameObject
can have.
Usage
Use the Flags
property to get or set the state flags of a GameObject
. This can be useful for checking the current state of the object or for setting specific states that affect how the object behaves in the scene.
Example
// Example of accessing and modifying the Flags property of a GameObject
GameObject myObject = new GameObject();
// Check if a specific flag is set
if ((myObject.Flags & GameObjectFlags.SomeFlag) != 0)
{
// Do something if the flag is set
}
// Set a specific flag
myObject.Flags |= GameObjectFlags.SomeFlag;
// Clear a specific flag
myObject.Flags &= ~GameObjectFlags.SomeFlag;