Files
UnrealEngineUWP/Engine/Plugins/Editor/EngineAssetDefinitions/Source/Private/EngineAssetDefinitionsModule.cpp
henrik karlsson 6c0988b13c [Engine/Plugins/Editor]
* Ran IWYU on all private code in the plugins under this folder.

#preflight 63bbb322c45a2c81e0673a9c
#rb chris.waters

[CL 23631839 by henrik karlsson in ue5-main branch]
2023-01-10 15:24:20 -05:00

46 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AssetDefinition_PoseAsset.h"
#define LOCTEXT_NAMESPACE "FEngineAssetDefinitionsModule"
class FEngineAssetDefinitionsModule : public IModuleInterface
{
public:
// IModuleInterface interface
virtual void StartupModule() override
{
// Register asset types... for now
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
RegisterAssetTypeAction(AssetTools, MakeShareable(new FAssetTypeActions_PoseAsset));
}
virtual void ShutdownModule() override
{
// Unregister all the asset types that we registered
if (FModuleManager::Get().IsModuleLoaded("AssetTools"))
{
IAssetTools& AssetTools = FModuleManager::GetModuleChecked<FAssetToolsModule>("AssetTools").Get();
for (int32 Index = 0; Index < CreatedAssetTypeActions.Num(); ++Index)
{
AssetTools.UnregisterAssetTypeActions(CreatedAssetTypeActions[Index].ToSharedRef());
}
}
CreatedAssetTypeActions.Empty();
}
private:
void RegisterAssetTypeAction(IAssetTools& AssetTools, TSharedRef<IAssetTypeActions> Action)
{
AssetTools.RegisterAssetTypeActions(Action);
CreatedAssetTypeActions.Add(Action);
}
TArray<TSharedPtr<IAssetTypeActions>> CreatedAssetTypeActions;
};
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FEngineAssetDefinitionsModule, EngineAssetDefinitions);