无法加载模块:public_UE4插件与模块

ad300b0a149fd4f0a570e5bc2d89c6ba.png

模块需要依赖项目 一般是引用项目做上层逻辑

插件独立与项目 并不依赖于项目 一般用作单独的功能 逻辑 每一个插件里最少有一个模块

d74a968ddf5a4674f56d573fbd84a25b.png

"Modules": [ //模块依赖 每一个插件内最少有一个模块
{
"Name": "Task", //模块名字
"Type": "Developer", // 模块类型
"LoadingPhase": "Default" //加载阶段
}

Type :: ↓

/**
 * Environment that can load a module.
 */
namespace EHostType
{
	enum Type
	{
		Runtime,  //任何情况下都会加载
		RuntimeNoCommandlet, //任何情况都会加载 但是不会加载命令
		RuntimeAndProgram,  //任何情况都会加载 小程序
		CookedOnly, //
		Developer, // 开发模式使用 打包不会调用
		Editor, // 编辑器启动时加载
		EditorNoCommandlet, //不加载命令
		Program,		//!< Program-only plugin type
		ServerOnly,
		ClientOnly,
		// NOTE: If you add a new value, make sure to update the ToString() method below!

		Max
	};

加载阶段 ↓

/**
 * Phase at which this module should be loaded during startup.
 */
namespace ELoadingPhase
{
	enum Type
	{
		/** Loaded before the engine is fully initialized, immediately after the config system has been initialized.  Necessary only for very low-level hooks */
		PostConfigInit,
              
		/** Loaded before coreUObject for setting up manual loading screens, used for our chunk patching system */
		PreEarlyLoadingScreen,

		/** Loaded before the engine is fully initialized for modules that need to hook into the loading screen before it triggers */
		PreLoadingScreen,

		/** Right before the default phase */
		PreDefault,

		/** Loaded at the default loading point during startup (during engine init, after game modules are loaded.) */
		Default,

		/** Right after the default phase */
		PostDefault,

		/** After the engine has been initialized */
		PostEngineInit,

		/** Do not automatically load this module */
		None,

		// NOTE: If you add a new value, make sure to update the ToString() method below!
		Max
	};

添加插件

180bda2e052685c7712b787c5476ad15.png
添加模块依赖 public内添加的话 依赖与此模块的其他模块就可以访问这个模块 如果私有的话就访问不到

10e22936d6f2a2891d401e03639334c1.png
添加启动项

.Build 链接

.Target 编译

项目内添加一个模块

在主模块的Target 添加 副模块名字 (副模块不能在引用主模块 会导致循环引用)

ce6ed3a8f885bb9f79b0cc893e38a4bc.png

5a7209d7902b047bc8d063994f6f02da.png
项目启动项内添加模块启动项