Description
The Has
method in the GameTags
class checks if the current object or any of its parent objects have a specific tag. This method is useful for determining if an entity or its hierarchy possesses a particular characteristic or label, which can be used for categorization, filtering, or behavior control within the game environment.
Usage
To use the Has
method, call it on an instance of GameTags
and pass the tag you want to check as a string parameter. The method will return true
if the tag is found on the object or any of its parents, otherwise it will return false
.
Example
// Example of using the Has method
GameTags gameTags = new GameTags();
// Check if the object or its parents have the tag "Player"
bool hasPlayerTag = gameTags.Has("Player");
if (hasPlayerTag)
{
// Perform actions if the tag is present
// e.g., apply player-specific logic
}