Description
The Add
method attempts to add a specified tag to the current object. Tags are strings that can be used to categorize or identify objects within the game environment. This method is part of the GameTags
class, which provides functionality for managing tags on game objects.
Usage
To use the Add
method, call it on an instance of GameTags
and pass the tag you wish to add as a string parameter. If the tag is successfully added, it will be associated with the object, allowing for easy identification and categorization.
Example
// Example of adding a tag to a game object
GameTags gameTags = new GameTags();
gameTags.Add("Player");
// Check if the tag was added
bool hasTag = gameTags.Has("Player");
// hasTag should be true if the tag was successfully added