Added unit tests for spawnable entity aliases.
This also fixes several issues discovered through the unit tests and renames a few functions to be clearer. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -220,7 +220,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
|
||||
if (it == aliasVisitors.end())
|
||||
{
|
||||
AzFramework::Spawnable::EntityAliasVisitor visitor = source->m_spawnable.TryGetAliases();
|
||||
AZ_Assert(visitor.HasLock(), "Unable to obtain lock for a newly create spawnable.");
|
||||
AZ_Assert(visitor.IsSet(), "Unable to obtain lock for a newly create spawnable.");
|
||||
it = aliasVisitors.emplace(source->m_spawnable.GetId(), AZStd::move(visitor)).first;
|
||||
}
|
||||
it->second.AddAlias(
|
||||
|
||||
+2
-1
@@ -42,7 +42,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
|
||||
{
|
||||
NoLoad, //!< Don't load the spawnable referenced in the entity alias. Loading will be up to the caller.
|
||||
QueueLoad, //!< Queue the spawnable referenced in the entity alias for loading. This will be an async load because asset
|
||||
//!< handlers aren't allowed to start a blocking load as this can lead to deadlocks.
|
||||
//!< handlers aren't allowed to start a blocking load as this can lead to deadlocks. This option will allow
|
||||
//!< to disable loading the referenced spawnable through the event fired from the spawnables asset handler.
|
||||
DependentLoad //!< The spawnable referenced in the entity alias is made a dependency of the spawnable that holds the entity
|
||||
//!< alias. This will cause the spawnable to be automatically loaded along with the owning spawnable.
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user