EnTT and Unreal 教程
https://entt.docsforge.com/master/entt-and-unreal-engine/#table-of-contents
BwdYeti/EnTTUE4
https://github.com/BwdYeti/EnTTUE4
UE4 C++ 教程
https://docs.unrealengine.com/4.27/zh-CN/ProgrammingAndScripting/ProgrammingWithCPP/IntroductionToCPP/
UE4 第三方库 教程
https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/ThirdPartyLibraries/
UE4 第三方库 教程
https://unreal.blog/how-to-include-any-third-party-library
HeyZoos/EnttUnrealTemplate
https://github.com/HeyZoos/EnttUnrealTemplate
bw2012/ue4_enable_c++17.txt
https://gist.github.com/bw2012/069bcb43d0983217dc36f782fc2f1bcc
本来打算在 UE4 上部署 EnTT,但是失败了,这应该是一篇失败记录hhh
一开始我是直接把
PCHUsage = PCHUsageMode.NoSharedPCHs;
PrivatePCHHeaderFile = "<PCH filename>.h";
CppStandard = CppStandardVersion.Cpp17;
放到了 build 的构造函数里面
比如我的游戏名叫 MUDTest,则 MUDTest.Build.cs 我写为
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class MUDTest : ModuleRules
{
public MUDTest(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] {
});
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
PCHUsage = PCHUsageMode.NoSharedPCHs;
PrivatePCHHeaderFile = "<PCH filename>.h";
CppStandard = CppStandardVersion.Cpp17;
}
}
然后我新建了一个继承 Actor 的类,建好了之后这个类却不显示,Output 为
Message dialog closed, result: Yes, title: Message, text: Successfully added class ‘MyActor’, however you must recompile the ‘MUDTest’ module before it will appear in the Content Browser. Failed to generate project files.
说我需要重新构建工程,我重新构建了之后报了错,构建函数返回错误,所以就是说明我的构建函数这么写是不行的
注释掉我新加的三行,重新构建,没有报错,编辑器里就会显示新建好的类了
这样说来,编辑器不显示新建类,既可能是因为这个类继承 None,也可能是因为构建错误
之后看了 BwdYeti/EnTTUE4 才知道要改成什么样hhh
本来我确实是知道 PCH filename
该改的,但是我不知道 PCH 是个啥,所以就没管
但是我看到别人这么写的话,感觉就是工程名
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class EnTTUE4 : ModuleRules
{
public EnTTUE4(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PrivatePCHHeaderFile = "PCH_EnTTUE4.h";
CppStandard = CppStandardVersion.Cpp17;
因此对于我自己就是
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class MUDTest : ModuleRules
{
public MUDTest(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] {
});
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
PCHUsage = PCHUsageMode.NoSharedPCHs;
PrivatePCHHeaderFile