Pawn/Pawn_Unreal/Source/PawnEditor/PawnEditorModule.cpp
2023-08-06 23:45:26 +02:00

26 lines
1.1 KiB
C++

#include "PawnEditorModule.h"
#include "PwnStyle.h"
#include "Customization/PwnInteractableActorCustomization.h"
#include "Interaction/PwnInteractableActor.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_MODULE(FPawnEditorModule, PawnEditor)
void FPawnEditorModule::StartupModule() {
FPwnStyle::Initialize();
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName(),
FOnGetPropertyTypeCustomizationInstance::CreateStatic(
&UPwnInteractableActorCustomization::MakeInstance));
PropertyModule.NotifyCustomizationModuleChanged();
}
void FPawnEditorModule::ShutdownModule() {
FPwnStyle::Shutdown();
if (FModuleManager::Get().IsModuleLoaded("PropertyEditor")) {
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.UnregisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName());
PropertyModule.NotifyCustomizationModuleChanged();
}
}