Fixes as per Ram's review

This commit is contained in:
daimini
2021-04-22 16:45:20 -07:00
parent 76739de282
commit 8f79379bc8
3 changed files with 3 additions and 10 deletions
@@ -38,7 +38,8 @@ namespace AzToolsFramework
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
//! Instantiate the prefab file provided.
//! /param entityToParentUnder The entity the newly created prefab instance is parented under.
//! /param filePath The filepath for the prefab file the instance should be created from.
//! /param instanceToParentUnder The instance the newly instantiated prefab instance is parented under.
//! /return The optional reference to the prefab instance.
virtual Prefab::InstanceOptionalReference InstantiatePrefab(
AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder = AZStd::nullopt) = 0;
@@ -53,10 +53,6 @@ namespace AzToolsFramework
AZ_Assert(m_loaderInterface != nullptr,
"Couldn't get prefab loader interface, it's a requirement for PrefabEntityOwnership system to work");
m_instanceEntityMapperInterface = AZ::Interface<Prefab::InstanceEntityMapperInterface>::Get();
AZ_Assert(m_instanceEntityMapperInterface != nullptr,
"Couldn't get instance entity mapper interface, it's a requirement for PrefabEntityOwnership system to work");
m_rootInstance = AZStd::unique_ptr<Prefab::Instance>(m_prefabSystemComponent->CreatePrefab({}, {}, "NewLevel.prefab"));
m_sliceOwnershipService.BusConnect(m_entityContextId);
@@ -325,9 +321,7 @@ namespace AzToolsFramework
}
Prefab::Instance& addedInstance = instanceToParentUnder->get().AddInstance(AZStd::move(createdPrefabInstance));
AZ::Entity* containerEntity = addedInstance.m_containerEntity.get();
HandleEntitiesAdded({containerEntity});
HandleEntitiesAdded({addedInstance.m_containerEntity.get()});
return addedInstance;
}
@@ -25,7 +25,6 @@ namespace AzToolsFramework
namespace Prefab
{
class Instance;
class InstanceEntityMapperInterface;
class PrefabSystemComponentInterface;
class PrefabLoaderInterface;
}
@@ -209,7 +208,6 @@ namespace AzToolsFramework
AZStd::string m_rootPath;
AZStd::unique_ptr<Prefab::Instance> m_rootInstance;
Prefab::InstanceEntityMapperInterface* m_instanceEntityMapperInterface;
Prefab::PrefabSystemComponentInterface* m_prefabSystemComponent;
Prefab::PrefabLoaderInterface* m_loaderInterface;
AzFramework::EntityContextId m_entityContextId;