Add logging missing object reference context when spawning prefab
#2414
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "Engine/Scripting/Scripting.h"
|
||||
#include "Engine/Scripting/Script.h"
|
||||
#include "Engine/Content/Asset.h"
|
||||
#include "Engine/Content/Content.h"
|
||||
#include "Engine/Level/Actor.h"
|
||||
#include "Engine/Threading/ThreadLocal.h"
|
||||
|
||||
@@ -83,6 +84,10 @@ void LogContext::Print(LogType verbosity)
|
||||
msg.AppendFormat(TEXT("object {} ({})"), String(typeName), context.ObjectID);
|
||||
}
|
||||
}
|
||||
else if (Asset* asset = Content::GetAsset(context.ObjectID))
|
||||
{
|
||||
msg.AppendFormat(TEXT("asset '{}' ({}, {})"), asset->GetPath(), asset->GetTypeName(), context.ObjectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.AppendFormat(TEXT("object {}"), context.ObjectID);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Engine/Core/Collections/CollectionPoolCache.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Core/Cache.h"
|
||||
#include "Engine/Core/LogContext.h"
|
||||
#include "Engine/Debug/Exceptions/ArgumentException.h"
|
||||
#include "Engine/Engine/EngineService.h"
|
||||
#include "Engine/Scripting/Script.h"
|
||||
@@ -122,6 +123,7 @@ Actor* PrefabManager::SpawnPrefab(Prefab* prefab, const Transform& transform, Ac
|
||||
}
|
||||
auto& data = *prefab->Data;
|
||||
SceneObjectsFactory::Context context(modifier.Value);
|
||||
LogContextScope logContext(prefabId);
|
||||
|
||||
// Deserialize prefab objects
|
||||
auto prevIdMapping = Scripting::ObjectsLookupIdMapping.Get();
|
||||
|
||||
Reference in New Issue
Block a user