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 flags that can be set on a GameObject
.
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 GameObject
or for modifying its behavior by setting specific flags.
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;