当前位置:网站首页>在UE内添加控制台工程(Programs)
在UE内添加控制台工程(Programs)
2022-06-26 01:55:00 【JK Chen】
流程
举例命名为 XmlToProto(自己替换)
在
项目目录/Source/Programs下新建文件夹 XmlToProto
内部新建文件夹Source,以及5个文件,文件内容见最下方
cmd 运行UBT
..\..\..\..\Engine\Binaries\DotNET\UnrealBuildTool.exe -ProjectFiles XXX\Source\Programs\XmlToProto会刷新.sln项目文件,之后重新打开VS就可以看到该工程了

可以像正常项目一样引用模块、插件(PublicDependencyModuleNames)
把主流程写到 XmlToProtoMainWindows.cpp 内的main函数内即可(RequestEngineExit之前,且这个函数不能跳过)
新建的代码文件都放到Source里面,不建议分Private和Public
文件内容
XmlToProto.Build.cs
using UnrealBuildTool; using System.IO; using System; public class XmlToProto : ModuleRules { public XmlToProto(ReadOnlyTargetRules Target) : base(Target) { PublicDependencyModuleNames.AddRange( new string[] { "Core", } ); PublicIncludePathModuleNames.AddRange( new string[] { "Launch", "CoreUObject", "Projects", "Json", "ApplicationCore", } ); PublicIncludePaths.Add(ModuleDirectory); bEnableExceptions = true; bUseUnity = false; } }XmlToProto.Target.cs
using UnrealBuildTool; using System.Collections.Generic; public class XmlToProtoTarget : TargetRules { public XmlToProtoTarget(TargetInfo Target) : base(Target) { Type = TargetType.Program; LinkType = TargetLinkType.Monolithic; DefaultBuildSettings = BuildSettingsVersion.V2; LaunchModuleName = "XmlToProto"; ExtraModuleNames.Add("EditorStyle"); // VS内的分类 SolutionDirectory = "GameTools"; bBuildDeveloperTools = false; // SlateViewer doesn't ever compile with the engine linked in bCompileAgainstEngine = false; // We need CoreUObject compiled in as the source code access module requires it bCompileAgainstCoreUObject = true; // SlateViewer.exe has no exports, so no need to verify that a .lib and .exp file was emitted by // the linker. bHasExports = false; // Make sure to get all code in SlateEditorStyle compiled in bBuildDeveloperTools = true; // UnrealPak is a console application, not a Windows app (sets entry point to main(), instead of WinMain()) bIsBuildingConsoleApplication = true; } }XmlToProtoApp.cpp
#include "XmlToProtoApp.h" #include "RequiredProgramMainCPPInclude.h" IMPLEMENT_APPLICATION(XmlToProto, "XmlToProto");XmlToProtoApp.h
#pragma onceXmlToProtoMainWindows.cpp
#include "CoreMinimal.h" int main(int argc, char* argv[]) { RequestEngineExit("Exit normally"); return 0; }
边栏推荐
- MySQL根据查询的数据更新记录
- 短信插件哪个好用万能表单需要发短信着急测试
- UTONMOS:以数字藏品助力华夏文化传承和数字科技发展
- 记一个RestControll和Controller 引起的折磨BUG
- leetcode 300. Longest increasing subsequence (medium)
- Explain the JVM clearly at one time and don't be asked by the interviewer again
- Here comes the official zero foundation introduction jetpack compose Chinese course!
- # 云原生训练营毕业总结
- Deep understanding of distributed cache design
- In depth good article: what is supernetting?
猜你喜欢

Ardiuno smart mosquito racket
![2022-06-25: given a positive number n, it means that there are tasks 0~n-1. Given an array of length N, time[i] means the time when task I is completed. Given a two-dimensional array matrix, matrix[j]](/img/93/d95255bae20b138851bdc8a50f8647.png)
2022-06-25: given a positive number n, it means that there are tasks 0~n-1. Given an array of length N, time[i] means the time when task I is completed. Given a two-dimensional array matrix, matrix[j]

GD32 ADC采集电压

Problem solving process of no internet access

数据库的授权

Redis6.0新特性——ACL(权限控制列表)实现限制用户可执行命令和KEY

Redis Lua沙盒绕过命令执行(CVE-2022-0543)
![[flask introduction series] flask processing request and response](/img/4b/bb5d915e83341183270d492b98f7d3.png)
[flask introduction series] flask processing request and response

Scala Basics (II): variables and data types

How do I take a screenshot of the iPad? 7 ways to take quick screenshots of iPad
随机推荐
A high-frequency interview question from a large factory: tell me about the solution of high and low interface idempotence? Solutions are attached.
分享一些在内网操作的远程办公经验| 社区征文
Scala Basics (II): variables and data types
One year's work
Pie chart metamorphosis record, the liver has 3000 words, collection is to learn!
The "more" option of Spreadtrum platform dearmcamera2 is removed
使用 AnnotationDbi 转换 R 中的基因名称
.NET7之MiniAPI(特别篇) :Preview5优化了JWT验证(下)
【机器学习】基于多元时间序列对高考预测分析案例
The programmer's eight-year salary change has made netizens envious: you pay me one year's salary per month
应届毕业生谈毕业的故事
基于 ovarian 数据集 进行生存分析
2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,
What happens when the cloud answer does not display the third-party login button
音视频与CPU架构
ORB-SLAM3论文概述
MySQL根据查询的数据更新记录
win32
Install development cross process communication
Multi surveyor Gongshu Xiao sir_ The solution of using websocket error reporting under working directory