Unreal Engine插件打包技巧

  1. 打开UE工程,点击编辑,选择插件,点击"打包"按钮,选择输出目录

  2. UE4.26版本打包提示需要VS2017问题解决 1)用记事本打开文件【UE4对应版本安装目录\Epic Games\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat】

    2)搜索【%UATExecutable% %* %UATCompileArg%】并删除本行

    3)在本行添加【%UATExecutable% %* -VS2019=true %UATCompileArg%】

    4)保存并关闭文件

    5)重启UE4并打包插件

  3. 编译比较严格,需要看报错提示补充类的前置申明以及头文件引用

    |-------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | //head文件 #include "CoreMinimal.h" #include "Subsystems/GameInstanceSubsystem.h" #include "Runtime/Online/HTTP/Public/Http.h" #include "Engine/EngineTypes.h" #include "VRVIUOnlineGameSubsystem.generated.h" class FJsonObject; //cpp文件 #include "VRVIUOnlineGameSubsystem.h" #include "Kismet/GameplayStatics.h" #include "SocketSubsystem.h" #include "Engine/World.h" #include "TimerManager.h" #include "Serialization/JsonReader.h" #include "Serialization/JsonWriter.h" #include "Serialization/JsonSerializer.h" |

  4. 把打包好的插件,拷贝到工程plugins目录下,删除private源码文件夹,修改".Build.cs"文件,添加编译条件bUsePrecompiled

    |----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | public class MultiPlayerPlugin : ModuleRules { ``public MultiPlayerPlugin(ReadOnlyTargetRules Target) : base(Target) ``{ ``bEnableUndefinedIdentifierWarnings = ``false``; ``PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; ``bUsePrecompiled = ``true``; ``PublicIncludePaths.AddRange( ``new string[] { ``"MultiPlayerPlugin/Public" ``} ``); ``PrivateIncludePaths.AddRange( ``new string[] { ``} ``); ``PublicDependencyModuleNames.AddRange( ``new string[] ``{ ``"Core" ``// ... add other public dependencies that you statically link with here ... ``} ``); ``PrivateDependencyModuleNames.AddRange( ``new string[] ``{ ``"CoreUObject"``, ``"Engine"``, ``"Slate"``, ``"SlateCore"``, ``"UMG"``, ``"Http"``, ``"Json"``, ``"JsonUtilities"``, ``"Sockets"``, ``"Networking" ``// ... add private dependencies that you statically link with here ... ``} ``); ``DynamicallyLoadedModuleNames.AddRange( ``new string[] ``{ ``// ... add any modules that your module loads dynamically here ... ``} ``); ``} } |

相关推荐
Magnum Lehar6 小时前
3d游戏引擎的Utilities模块实现下
c++·算法·游戏引擎
虾球xz10 小时前
游戏引擎学习第277天:稀疏实体系统
c++·学习·游戏引擎
虾球xz12 小时前
游戏引擎学习第276天:调整身体动画
c++·学习·游戏引擎
虾球xz12 小时前
游戏引擎学习第275天:将旋转和剪切传递给渲染器
c++·学习·游戏引擎
虾球xz17 小时前
游戏引擎学习第268天:合并调试链表与分组
c++·学习·链表·游戏引擎
qq_5982117571 天前
Unity.UGUI DrawCall合批笔记
笔记·unity·游戏引擎
南玖yy1 天前
C/C++ 内存管理深度解析:从内存分布到实践应用(malloc和new,free和delete的对比与使用,定位 new )
c语言·开发语言·c++·笔记·后端·游戏引擎·课程设计
虾球xz1 天前
游戏引擎学习第272天:显式移动转换
c++·学习·游戏引擎
笑鸿的学习笔记2 天前
虚幻引擎5-Unreal Engine笔记之常用核心类的继承关系
笔记·ue5·虚幻
咩咩觉主2 天前
c#数据结构 线性表篇 非常用线性集合总结
开发语言·数据结构·unity·c#·游戏引擎·程序框架