Implement tags recursive addition

This commit is contained in:
Wiktor Kocielski
2023-09-06 05:43:27 +03:00
parent 7c9959bca5
commit d9a1eb349d
2 changed files with 14 additions and 1 deletions

View File

@@ -489,6 +489,13 @@ void Actor::AddTag(const Tag& tag)
Tags.AddUnique(tag);
}
void Actor::AddTagRecursive(const Tag& tag)
{
for (const auto& child : Children)
child->AddTagRecursive(tag);
Tags.AddUnique(tag);
}
PRAGMA_DISABLE_DEPRECATION_WARNINGS
const String& Actor::GetTag() const

View File

@@ -120,7 +120,7 @@ public:
API_PROPERTY() void SetLayerName(const StringView& value);
/// <summary>
/// Sets the name of the layer recursively for all underlying children.
/// Sets the name of the layer recursively for actor and for all underlying child actors.
/// </summary>
API_FUNCTION() void SetLayerNameRecursive(const StringView& value);
@@ -147,6 +147,12 @@ public:
/// <param name="tag">The tag to add.</param>
API_FUNCTION() void AddTag(const Tag& tag);
/// <summary>
/// Adds a tag to the actor and for all underlying child actors.
/// </summary>
/// <param name="tag">The tag to add.</param>
API_FUNCTION() void AddTagRecursive(const Tag& tag);
/// <summary>
/// Gets the name of the tag.
/// [Deprecated in v1.5]