Description
The Tags
property of a Component
in the Sandbox framework provides access to the set of tags associated with the component. Tags are used to categorize or identify components in a flexible way, allowing for easy grouping and querying of components based on their tags.
Usage
Use the Tags
property to add, remove, or check for specific tags on a component. This can be useful for organizing components or for implementing logic that depends on the presence of certain tags.
Example
// Example of using the Tags property
Component myComponent = new Component();
// Add a tag to the component
myComponent.Tags.Add("Player");
// Check if the component has a specific tag
bool isPlayer = myComponent.Tags.Contains("Player");
// Remove a tag from the component
myComponent.Tags.Remove("Player");