Q1. 虚幻引擎的Main函数在哪?
LaunchWindows.cpp 中找到 WinMain。
Q2. 虚幻引擎为什么要引入模块机制?
编辑器模式、发布模式要单独配置非常麻烦。
工具:Unreal Build Tool
包含大模块:Runtime、Development、Editor、Plugin
每个模块包含:Public、Private文件夹,.build.cs文件
作用域:只有XXXX_API宏暴露的类和成员才能被其他模块访问
Q3. 如何创建自定义模块?
1. 创建模块文件夹结构; 2. 创建模块构建文件.build.cs; 3. 创建模块头文件与实现文件; 4. 创建模块预编译头文件PrivatePCH.h; 5. 创建模块的C++声明和定义。 详细步骤见书P82 Q4.模块的加载顺序? 1)Platform File Module 读取文件 2)FEngineLoop::PreInit->LoadCoreModules 加载核心模块 3)加载 CoreUObject 4)FEngineLoop::LoadPreInitModules 5)加载 Engine 6)加载 Renderer 7)加载 AnimGraphRuntime 8)加载平台相关模块(D3D、OpenGL、StartupCoreModules、Core、Networking、UMG、MessageLog) 9)启用的插件对应模块 10)TaskGraph、ProfilerService Q5. UE大概有哪些模块?Documentation | WorkspaceMenuStructure | MainFrame | GammaUI | OutputLog |
SourceControl | TextureCompressor | MeshUtilities | MovieSceneTools | ModuleUI |
Toolbox | ClassViewer | ContentBrowser | AssetTools | GraphEditor |
KismetCompiler | Kismet | Persona | LevelEditor | MainFrame |
PropertyEditor | EditorStyle | PackagesDialog | AssetRegistry | DetailCustomizations |
ComponentVisualizers | Layers | AutomationWindow | AutomationController | DeviceManager |
ProfilerClient | SessionFrontend | ProjectLauncher | SettingsEditor | EditorSettingsViewer |
ProjectSettingsViewer | Blutility | OnlineBlueprintSupport | XmlParser | UserFeedback |
GameplayTagsEditor | UndoHistory | DeviceProfileEditor | SourceCodeAccess | BehaviorTreeEditor |
HardwareTargetin | LocalizationDashboard | ReferenceViewer | TreeMap | SizeMap |
MergeActors |
Unreal Build Tool |
跨平台工具 职能: 1.收集阶段:收集环境变量、源代码目录、引擎目录、工程目录 2.参数解析阶段:解析命令行参数 3.实际生成阶段:生成makefile 4. 监视是否需要热加载 |
Unreal Header Tool |
编译头文件后,把UPROPERTY和UFUNCTION标记的信息获取过程记录在.generated.cpp里 加载信息:在.generated.cpp里声明宏:IMPLEMENT_CLASS(声明了静态全局变量,实现了当前类函数),利用静态全局变量初始化先于Main函数,选择先加载哪些信息 |