Files
UnrealEngineUWP/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Private/SmartObjectsModule.cpp
Yoan StAmant 16f58dabda [SmartObject] Added GameplayDebuggerCategory_SmartObject
First pass includes stats for registered objects (collection entries, runtime active objects, loaded components) and visuals for slots
#rb mieszko.zielinski, mikko.mononen
#preflight 61827c8b2b589a00015ae20f
#robomerge FnMain

[CL 18033215 by Yoan StAmant in ue5-main branch]
2021-11-03 10:04:28 -04:00

46 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SmartObjectsModule.h"
#include "Modules/ModuleManager.h"
#if WITH_GAMEPLAY_DEBUGGER
#include "GameplayDebugger.h"
#include "GameplayDebuggerCategory_SmartObject.h"
#endif
#define LOCTEXT_NAMESPACE "SmartObjects"
class FSmartObjectsModule : public ISmartObjectsModule
{
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
IMPLEMENT_MODULE(FSmartObjectsModule, SmartObjectsModule)
void FSmartObjectsModule::StartupModule()
{
#if WITH_GAMEPLAY_DEBUGGER
IGameplayDebugger& GameplayDebuggerModule = IGameplayDebugger::Get();
GameplayDebuggerModule.RegisterCategory("SmartObject",
IGameplayDebugger::FOnGetCategory::CreateStatic(&FGameplayDebuggerCategory_SmartObject::MakeInstance),
EGameplayDebuggerCategoryState::EnabledInGameAndSimulate);
GameplayDebuggerModule.NotifyCategoriesChanged();
#endif
}
void FSmartObjectsModule::ShutdownModule()
{
#if WITH_GAMEPLAY_DEBUGGER
if (IGameplayDebugger::IsAvailable())
{
IGameplayDebugger& GameplayDebuggerModule = IGameplayDebugger::Get();
GameplayDebuggerModule.UnregisterCategory("SmartObject");
GameplayDebuggerModule.NotifyCategoriesChanged();
}
#endif
}
#undef LOCTEXT_NAMESPACE