SetComponentProperty is now supported by undo operation (#5599)

* Adding undo support to SetComponentProperty to make it function with prefab system

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>

* Renaming a variable

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>

* PR feedback

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>
This commit is contained in:
Mikhail Naumov
2021-11-15 13:01:42 -06:00
committed by GitHub
parent 5c0fe6a54f
commit b3e2c3f075
@@ -597,11 +597,13 @@ namespace AzToolsFramework
pte.SetVisibleEnforcement(true);
}
ScopedUndoBatch undo("Modify Entity Property");
PropertyOutcome result = pte.SetProperty(propertyPath, value);
if (result.IsSuccess())
{
PropertyEditorEntityChangeNotificationBus::Event(componentInstance.GetEntityId(), &PropertyEditorEntityChangeNotifications::OnEntityComponentPropertyChanged, componentInstance.GetComponentId());
}
undo.MarkEntityDirty(componentInstance.GetEntityId());
return result;
}