Actor naming without string copy fix
This commit is contained in:
@@ -543,6 +543,15 @@ void Actor::SetLayerRecursive(int32 layerIndex)
|
||||
OnLayerChanged();
|
||||
}
|
||||
|
||||
void Actor::SetName(String&& value)
|
||||
{
|
||||
if (_name == value)
|
||||
return;
|
||||
_name = MoveTemp(value);
|
||||
if (GetScene())
|
||||
Level::callActorEvent(Level::ActorEventType::OnActorNameChanged, this, nullptr);
|
||||
}
|
||||
|
||||
void Actor::SetName(const StringView& value)
|
||||
{
|
||||
if (_name == value)
|
||||
|
||||
@@ -181,6 +181,11 @@ public:
|
||||
return _name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the actor name without copying the string.
|
||||
/// </summary>
|
||||
API_FUNCTION() void SetName(String&& value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the actor name.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user