使用ue打包web页面,只能使用旧版本,新版本没有打包html选项,应该是编辑器主要完善效果,导致轻量级的html很多东西不兼容。新版本提供了推流的方式替代。
示例工程里有个PixelStreaming的示例项目,直接下载打开那个项目。据说新工程直接在插件里下这个插件也是可以直接用的,但我没试。
打开后可以在编辑器里直接推流。
两个端口号应该是需要唯一,不清楚之后遇到的bug是不是和这块有关。viewerport就是在浏览器里要输入的端口号,可以推送关卡编辑页面或者整个编辑器。
接下来是打包,直接平台,windows,打包,结果报错。
LogUObjectHash: Compacting FUObjectHashTables data took 0.80ms
LogTurnkeySupport: Project requires temp target (已启用PixelStreaming插件)
LogLauncherProfile: Unable to use promoted target - ../../../../../UEProject/WebTest/Binaries/Win64/UnrealGame.target does not exist.
LogMonitoredProcess: Running Serialized UAT: [ cmd.exe /c ""D:/UE/UE_5.3/Engine/Build/BatchFiles/RunUAT.bat" -ScriptsForProject="D:/UEProject/WebTest/WebTest.uproject" Turnkey -command=VerifySdk -platform=Win64 -UpdateIfNeeded -EditorIO -EditorIOPort=52370 -project="D:/UEProject/WebTest/WebTest.uproject" BuildCookRun -nop4 -utf8output -nocompileeditor -skipbuildeditor -cook -project="D:/UEProject/WebTest/WebTest.uproject" -unrealexe="D:\UE\UE_5.3\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" -platform=Win64 -installed -stage -archive -package -build -clean -pak -iostore -compressed -prereqs
-archivedirectory="D:/UEProject/WebTest/build" -clientconfig=Development" -nocompile -nocompileuat ]
UATHelper: 打包 (Windows): Running AutomationTool...
UATHelper: 打包 (Windows): Using bundled DotNet SDK version: 6.0.302
UATHelper: 打包 (Windows): Starting AutomationTool...
UATHelper: 打包 (Windows): Parsing command line: -ScriptsForProject=D:/UEProject/WebTest/WebTest.uproject Turnkey -command=VerifySdk -platform=Win64 -UpdateIfNeeded -EditorIO -EditorIOPort=52370 -project=D:/UEProject/WebTest/WebTest.uproject BuildCookRun -nop4 -utf8output -nocompile