Ignore constant error due to missing Game Settings in Editor (log once)
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
#include "Engine/Engine/Globals.h"
|
#include "Engine/Engine/Globals.h"
|
||||||
#include "Engine/Profiler/ProfilerCPU.h"
|
#include "Engine/Profiler/ProfilerCPU.h"
|
||||||
#include "Engine/Streaming/StreamingSettings.h"
|
#include "Engine/Streaming/StreamingSettings.h"
|
||||||
#if FLAX_TESTS
|
#if FLAX_TESTS || USE_EDITOR
|
||||||
#include "Engine/Platform/FileSystem.h"
|
#include "Engine/Platform/FileSystem.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -91,6 +91,19 @@ GameSettings* GameSettings::Get()
|
|||||||
// Silence missing GameSettings during test run before Editor creates it (not important)
|
// Silence missing GameSettings during test run before Editor creates it (not important)
|
||||||
if (!FileSystem::FileExists(assetPath))
|
if (!FileSystem::FileExists(assetPath))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
#endif
|
||||||
|
#if USE_EDITOR
|
||||||
|
// Log once missing GameSettings in Editor
|
||||||
|
if (!FileSystem::FileExists(assetPath))
|
||||||
|
{
|
||||||
|
static bool LogOnce = true;
|
||||||
|
if (LogOnce)
|
||||||
|
{
|
||||||
|
LogOnce = false;
|
||||||
|
LOG(Error, "Missing file game settings asset ({0}\)", assetPath);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
GameSettingsAsset = Content::LoadAsync<JsonAsset>(assetPath);
|
GameSettingsAsset = Content::LoadAsync<JsonAsset>(assetPath);
|
||||||
if (GameSettingsAsset == nullptr)
|
if (GameSettingsAsset == nullptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user