小技巧

1.添加module的流程
右键.uproject文件 添加新的模块
{
"FileVersion": 3,
"EngineAssociation": "4.16",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "UE4Cook",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine",
"CoreUObject"
]
},
{
"Name": "UE4CookTestEditor", //新模块名称
"Type": "Editor", //运行模式 Runtime 表示 既在editor模式下运行 又在发布版运行
"LoadingPhase": "PostEngineInit", //模块加载时机
"AdditionalDependencies": [
"Engine",
"CoreUObject"
]
}
]
}
添加配置文件
在Source下 参照原有的文件接口 添加UE4CookTestEditor 文件夹 里面相应创建xx.h xx.build.cs xx.cpp文件
.build.cs
using UnrealBuildTool;

public class UE4CookTestEditor : ModuleRules
{
public UE4CookTestEditor(ReadOnlyTargetRules Target) : base(Target)
{
PublicDependencyModuleNames.AddRange(new string[] {"Core", "CoreUObject", "Engine", "InputCore", "RHI","RenderCore", "ShaderCore" });
PublicDependencyModuleNames.Add("UE4Cook"); //主模块
PrivateDependencyModuleNames.AddRange(new string[] {"UnrealEd" });
}
}

2.查找UEBuildWindows.cs文件,里面记录了此版本的UE4可以用哪个版本的VS编译

原文地址:https://www.cnblogs.com/cdprojekt/p/13500186.html