diff --git a/Source/Engine/Level/Tags.cpp b/Source/Engine/Level/Tags.cpp index c12fed765..f1edeb91c 100644 --- a/Source/Engine/Level/Tags.cpp +++ b/Source/Engine/Level/Tags.cpp @@ -55,6 +55,11 @@ Tag Tags::Get(const StringView& tagName) return tag; } +Tag Tags::Find(const StringView& tagName) +{ + return Tag(List.Find(tagName) + 1); +} + Array Tags::GetSubTags(Tag parentTag) { Array subTags; diff --git a/Source/Engine/Level/Tags.h b/Source/Engine/Level/Tags.h index 7c261f313..350c88796 100644 --- a/Source/Engine/Level/Tags.h +++ b/Source/Engine/Level/Tags.h @@ -92,6 +92,13 @@ API_CLASS(Static) class FLAXENGINE_API Tags /// The tag. API_FUNCTION() static Tag Get(const StringView& tagName); + /// + /// Gets the tag. Returns empty one if it doesn't exist. + /// + /// The tag name. + /// The tag (might be empty). + API_FUNCTION() static Tag Find(const StringView& tagName); + /// /// Get all subtags of the specific Tag ///