|
|
|
|
@ -17,16 +17,17 @@ namespace AzToolsFramework
|
|
|
|
|
{
|
|
|
|
|
PrefabUndoBase::PrefabUndoBase(const AZStd::string& undoOperationName)
|
|
|
|
|
: UndoSystem::URSequencePoint(undoOperationName)
|
|
|
|
|
, m_changed(true)
|
|
|
|
|
, m_templateId(InvalidTemplateId)
|
|
|
|
|
{
|
|
|
|
|
m_instanceToTemplateInterface = AZ::Interface<InstanceToTemplateInterface>::Get();
|
|
|
|
|
AZ_Assert(m_instanceToTemplateInterface, "Failed to grab instance to template interface");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//PrefabInstanceUndo
|
|
|
|
|
PrefabUndoInstance::PrefabUndoInstance(const AZStd::string& undoOperationName, bool useImmediatePropagation)
|
|
|
|
|
PrefabUndoInstance::PrefabUndoInstance(const AZStd::string& undoOperationName)
|
|
|
|
|
: PrefabUndoBase(undoOperationName)
|
|
|
|
|
{
|
|
|
|
|
m_useImmediatePropagation = useImmediatePropagation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PrefabUndoInstance::Capture(
|
|
|
|
|
@ -42,12 +43,17 @@ namespace AzToolsFramework
|
|
|
|
|
|
|
|
|
|
void PrefabUndoInstance::Undo()
|
|
|
|
|
{
|
|
|
|
|
m_instanceToTemplateInterface->PatchTemplate(m_undoPatch, m_templateId, m_useImmediatePropagation);
|
|
|
|
|
m_instanceToTemplateInterface->PatchTemplate(m_undoPatch, m_templateId, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PrefabUndoInstance::Redo()
|
|
|
|
|
{
|
|
|
|
|
m_instanceToTemplateInterface->PatchTemplate(m_redoPatch, m_templateId, m_useImmediatePropagation);
|
|
|
|
|
m_instanceToTemplateInterface->PatchTemplate(m_redoPatch, m_templateId, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PrefabUndoInstance::RedoBatched()
|
|
|
|
|
{
|
|
|
|
|
m_instanceToTemplateInterface->PatchTemplate(m_redoPatch, m_templateId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|