创建一个UObject子类,将需要配置的变量实现在其中,UClass中的两个设置可以自己更改,变量宏需添加config
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "CrashToolRuntimeSetting.generated.h"
UCLASS(Config = Engine , defaultconfig)
class CRASHTOOL_API UCrashToolRuntimeSetting : public UObject
{
GENERATED_BODY()
public:
UCrashToolRuntimeSetting(const FObjectInitializer& ObjectInitializer)
:Super(ObjectInitializer)
,bEnabled(false)
,Address("")
{
}
UPROPERTY(EditAnywhere,Config,Category="CrashTool")
bool bEnabled;
UPROPERTY(EditAnywhere,Config,Category="CrashTool")
FString Address;
};
在模块加载时候注册他们,注册的位置填写一级一级的字符串而定
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
class FCrashToolModule : public IModuleInterface
{
public:
virtual