Restore Actor.Tag property as deprecated for backwards compatibility

Regression from a570d6d178
This commit is contained in:
Wojtek Figat
2023-02-19 11:25:37 +01:00
parent 7a5d84a216
commit dc04d3dc0b
2 changed files with 28 additions and 0 deletions

View File

@@ -471,6 +471,21 @@ bool Actor::HasTag(const StringView& tag) const
return Tags.Contains(tag);
}
PRAGMA_DISABLE_DEPRECATION_WARNINGS
const String& Actor::GetTag() const
{
return Tags.Count() != 0 ? Tags[0].ToString() : String::Empty;
}
void Actor::SetTag(const StringView& value)
{
const Tag tag = Tags::Get(value);
Tags.Set(&tag, 1);
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
void Actor::SetLayer(int32 layerIndex)
{
layerIndex = Math::Clamp(layerIndex, 0, 31);

View File

@@ -130,6 +130,19 @@ public:
/// <param name="tag">The tag to check.</param>
API_FUNCTION() bool HasTag(const StringView& tag) const;
/// <summary>
/// Gets the name of the tag.
/// [Deprecated in v1.5]
/// </summary>
API_PROPERTY(Attributes="HideInEditor, NoSerialize, NoAnimate")
DEPRECATED const String& GetTag() const;
/// <summary>
/// Sets the name of the tag.
/// [Deprecated in v1.5]
/// </summary>
API_PROPERTY() DEPRECATED void SetTag(const StringView& value);
/// <summary>
/// Gets the actor name.
/// </summary>