导语:
视频在文末
1、uproject,以商城下载的ActionRPG为例
{
"FileVersion": 3,
"EngineAssociation": "4.20",
"Category": "Samples",
"Description": "",
"Modules": [
{
"Name": "ActionRPG",
"Type": "Runtime",
"LoadingPhase": "Default"
},
{
"Name": "ActionRPGLoadingScreen",
"Type": "ClientOnly",
"LoadingPhase": "PreLoadingScreen"
}
],
"Plugins": [
{
"Name": "AppleARKit",
"Enabled": false
},
{
"Name": "ArchVisCharacter",
"Enabled": false
},
还有很多...
],
"TargetPlatforms": [
"Android",
"IOS",
"WindowsNoEditor",
"MacNoEditor"
],
"EpicSampleNameHash": "2961006109"
}
结构定义:
/** Category to show under the project browser */
FString Category;
/** Description to show in the project browser */
FString Description;
/** List of all modules associated with this project */
TArray<FModuleDescriptor> Modules;
/** List of plugins for this project (may be enabled/disabled) */
TArray<FPluginReferenceDescriptor> Plugins;
/** Array of platforms that this project is targeting */
TArray<FName> TargetPlatforms;
/** A hash that is used to determine if the project was forked from a sample */
uint32 EpicSampleNameHash;
/** Custom steps to execute before building targets in this project */
FCustomBuildSteps PreBuildSteps;
/** Custom steps to execute after building targets in this project */
FCustomBuildSteps PostBuildSteps;
/** Indicates if this project is an Enterprise project */
bool bIsEnterpriseProject;
2、
Config 保存配置文件
Content: 游戏内容
Intermediate: 构建项目和使用引擎用于中间步骤的临时文件和文件夹,删除后,启动工程要更久
Saved: 和Intermediate类似,不过存储着更重要的文件,比如日志系统,Saved引擎崩溃后会尝试恢复文件和文件夹
Binaries: 临时文件夹,保存着编译好的二进制代码以及与模块相关的DLL文件,会在编译项目时创建
3、DDC
派生数据缓存 DDC,就是以引擎及其目标平台所用的资源格式,来保存各版本的资源缓存
比如着色器编译数据
默认路径:C:\Users\Admin\AppData\Local\UnrealEngine
在多人项目中,可以修改衍生文件的目录,增加编译速度
官方文档: 可以修改路径
4、模块结构
每个模块都有一个模块实现文件, Build.cs 用于告诉编译器模块的编译方式,这个文件不是C++文件,而是用C#编写的文件,这是因为我们的构建工具“虚幻构建工具”简称UBT 使用C#编写,UBT在每次编译项目时,解析并搜索项目中的所有目录,寻找"build.cs"文件,并构建所有可用模块的列表,然后它会编译这些“Build.cs”文件,并将它作为编译的一部分执行,
PublicDependencyModuleName:公有依赖项,它们会被重新公开给其他依赖于该模块的模块,
PrivateIncludePaths:字符串集合,必须手动指定它下面有哪些子目录,公有目录会自动检测
编辑模块本身时使用“专有依赖关系”。“公有依赖关系”将重新导出至依赖于该模块的其它模块。