Remove container entity from all maps when entities are cleared from a prefab instance
Signed-off-by: srikappa-amzn <srikappa@amazon.com>
This commit is contained in:
@@ -237,7 +237,6 @@ namespace AzToolsFramework
|
||||
|
||||
if (m_containerEntity)
|
||||
{
|
||||
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
|
||||
m_containerEntity.reset(aznew AZ::Entity());
|
||||
RegisterEntity(m_containerEntity->GetId(), GenerateEntityAlias());
|
||||
}
|
||||
@@ -265,6 +264,11 @@ namespace AzToolsFramework
|
||||
|
||||
void Instance::ClearEntities()
|
||||
{
|
||||
if (m_containerEntity)
|
||||
{
|
||||
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
|
||||
}
|
||||
|
||||
for (const auto&[entityAlias, entity] : m_entities)
|
||||
{
|
||||
if (entity)
|
||||
|
||||
-1
@@ -168,7 +168,6 @@ namespace AzToolsFramework
|
||||
|
||||
if (instance->m_containerEntity)
|
||||
{
|
||||
instance->m_instanceEntityMapper->UnregisterEntity(instance->m_containerEntity->GetId());
|
||||
instance->m_containerEntity.reset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user