Fix for unit test. Checking that AssetManager is ready before spawning entities; MultiplayerSystemComponent will attempt to spawn a default player on init(), but during unit tests the AssetManager isn't stood up
This commit is contained in:
@@ -402,8 +402,12 @@ namespace Multiplayer
|
||||
const AZ::Transform& transform
|
||||
)
|
||||
{
|
||||
INetworkEntityManager::EntityList returnList;
|
||||
|
||||
EntityList returnList;
|
||||
if (!AZ::Data::AssetManager::IsReady())
|
||||
{
|
||||
return returnList;
|
||||
}
|
||||
|
||||
auto spawnableAssetId = m_networkPrefabLibrary.GetAssetIdByName(prefabEntryId.m_prefabName);
|
||||
// Required for sync-instantiation. Todo: keep the reference in NetworkSpawnableLibrary
|
||||
auto netSpawnableAsset = AZ::Data::AssetManager::Instance().GetAsset<AzFramework::Spawnable>(spawnableAssetId, AZ::Data::AssetLoadBehavior::PreLoad);
|
||||
|
||||
Reference in New Issue
Block a user