继续上一篇,用写字版打开新建的C++ 和 Blueprint Project 下唯一的 .uproject 文件
以及插件目录下的.uplugin 作个对比,会发现都是json格式
C++ 下无论是项目还是插件,Modules的格式都是一样的
"Modules": [
{
"Name": "TestPlug01",
"Type": "Runtime",
"LoadingPhase": "Default"
}
]
其中 Name = 插件名称
根据这个名称,可以在目录\Source下找到一一对应Name的目录名
另外两个参数 Type 和 LoadingPhase 顺着文本搜索全引擎,可以找到
\Engine\Source\Runtime\Projects\Public\ModuleDescriptor.h 下的枚举
Type 的值对应着
enum Type
{
// Loads on all targets, except programs.
Runtime,
// Loads on all targets, except programs and the editor running commandlets.
RuntimeNoCommandlet,
// Loads on all targets, including supported programs.
RuntimeAndProgram,
// Loads only in cooked games.
CookedOnly,
// Only loads in uncooked games.
UncookedOnly,
// Deprecated due to ambiguities. Only loads in editor and program targets, but loads in any editor mode (eg. -game, -server).
// Use UncookedOnly for the same behavior (eg. for editor blueprint nodes needed in uncooked games), or DeveloperTool for modules
// that can also be loaded in cooked games but should not be shipped (eg. debugging utilities).
Developer,
// Loads on any targets where bBuildDeveloperTools is enabled.
DeveloperTool,
// Loads only when the editor is starting up.
Editor,
// Loads only when the editor is starting up, but not in commandlet mode.
EditorNoCommandlet,
// Loads only on editor and program targets
EditorAndProgram,
// Only loads on program targets.
Program,
// Loads on all targets except dedicated clients.
ServerOnly,
// Loads on all targets except dedicated servers.
ClientOnly,
// Loads in editor and client but not in commandlets.
ClientOnlyNoCommandlet,
//~ NOTE: If you add a new value, make sure to update the ToString() method below!
Max
};
很多是不是,到目前为止我只见过 "Type":"Runtime" 和 "Type":"Editor" 这2种用法,当然了,我是小白。
LoadingPhase 同样对应着枚举
enum LoadingPhase
{
/** As soon as possible - in other words, uplugin files are loadable from a pak file (as well as right after PlatformFile is set up in case pak files aren't used) Used for plugins needed to read files (compression formats, etc) */
EarliestPossible,
/** Loaded before the engine is fully initialized, immediately after the config system has been initialized. Necessary only for very low-level hooks */
PostConfigInit,
/** The first screen to be rendered after system splash screen */
PostSplashScreen,
/** Loaded before coreUObject for setting up manual loading screens, used for our chunk patching system */
PreEarlyLoadingScreen,
/** Loaded before the engine is fu