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 ... ``} ``); ``} } |

相关推荐
心疼你的一切17 分钟前
【技术创作的璀璨盛宴——2025年CSDN博客之星总评选深度总结】
microsoft·unity·游戏引擎·游戏程序·csdn·博客之星
心前阳光1 小时前
Unity的VideoPlayer准备完成回调注意
unity·游戏引擎
small-pudding3 小时前
Cocos Creator 3.x RichText 实现关键词悬停提示(基于 `_segments` 的扩展实践)
游戏引擎
猫不吃咸鱼5 小时前
Unity单手轮盘控制2D/3D物体移动
3d·unity·游戏引擎
向宇it1 天前
2025年技术总结 | 在Unity游戏开发路上的持续探索与沉淀
游戏·unity·c#·游戏引擎
技术小甜甜1 天前
【Godot】【入门】输入系统详解:InputMap 动作映射(键鼠/手柄一套代码通吃)
游戏引擎·godot
Thomas_YXQ1 天前
Unity3D IL2CPP如何调用Burst
开发语言·unity·编辑器·游戏引擎
u9king1 天前
虚幻引擎UE5.6编译卡在rc2.exe长时间未响应的解决方法
visualstudio·ue5·虚幻·ue5.6·rc2.exe
老朱佩琪!2 天前
Unity享元模式
unity·游戏引擎·享元模式
三和尚2 天前
AI开发之Cursor的下载安装以及Unity-MCP下载安装到你的个人Unity项目中(一)
unity·ai·游戏引擎·cursor·unity-mcp·unity自动化