虚幻引擎4空白模块
Unreal Engine 4 Blank Module
我正试图进入虚幻引擎4模块开发,开始与空白模块初学者,但在开始时击中一个块。
我经历了一个非游戏模块的教程:https://wiki.unrealengine.com/An_Int...to_UE4_Plugins。我试着完全通过源代码,后来修改一切到TestPlugin(因为我也不能通过教程让它工作)。
由于某种原因,每当我尝试激活编辑器中的模块时,我都会得到"找不到"模块"模块"。我想弄清楚如果我错过了什么,这是我到目前为止的代码:
. ./发动机/插件/TestPlugin/TestPlugin.uplugin
{
"FileVersion" : 3,
"FriendlyName" : "Test Plugin",
"Version" : 1,
"VersionName": "1.0",
"EngineVersion" : 1579795,
"Description" : "Description goes here",
"Category" : "Test.Module",
"CreatedBy" : "arhon",
"CreatedByURL" : "http://stackoverflowcom",
"CanContainContent" : "true",
"Modules" :
[
{
"Name" : "Module",
"Type" : "Developer",
"LoadingPhase" : "PreDefault"
}
]
}
. ./发动机/插件/TestPlugin/源/TestPlugin TestPlugin.cpp
void FTestPlugin::StartupTestPlugin()
{
if (ITestPlugin::IsAvailable())
{
UE_LOG(TestPlugin, Log, TEXT("%s"), ITestPlugin::Get().IsThisNumber42(42) ? TEXT("True") : TEXT("False"));
UE_LOG(TestPlugin, Log, TEXT("%s"), ITestPlugin::Get().IsThisNumber42(12) ? TEXT("True") : TEXT("False"));
}
}
. ./发动机/插件/TestPlugin/源/TestPlugin TestPlugin.Build.cs
using UnrealBuildTool;
public class TestPlugin : ModuleRules
{
public TestPlugin(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { "TestPlugin" });
DynamicallyLoadedModuleNames.AddRange(new string[] { "StandAlone" });
}
}
. ./发动机/插件/TestPlugin/源/TestPlugin/公共/ITestPlugin.h
#pragma once
#include "ModuleManager.h"
/**
* The public interface to this module. In most cases, this interface is only public to sibling modules
* within this plugin.
*/
class ITestPlugin : public ITestPluginInterface
{
public:
/**
* Singleton-like access to this module's interface. This is just for convenience!
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
*
* @return Returns singleton instance, loading the module on demand if needed
*/
static inline ITestPlugin& Get()
{
return FModuleManager::LoadModuleChecked< ITestPlugin >("TestPlugin");
}
/**
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
*
* @return True if the module is loaded and ready to use
*/
static inline bool IsAvailable()
{
return FModuleManager::Get().IsModuleLoaded("TestPlugin");
}
virtual bool IsThisNumber42(int32 num) = 0;
};
. ./发动机/插件/TestPlugin/源/TestPlugin/私人/TestPluginPrivatePCH.h
#include "ITestPlugin.h"
// You should place include statements to your module's private header files here. You only need to
// add includes for headers that are used in most of your module's source files though.
. ./发动机/插件/TestPlugin/源/TestPlugin/私人/TestPlugin.h
#pragma once
class TestPluginImpl : public ITestPlugin
{
public:
/** IModuleInterface implementation */
void StartupTestPlugin();
void ShutdownTestPlugin();
bool IsThisNumber42(int32 num);
};
. ./发动机/插件/TestPlugin/源/TestPlugin/私人/TestPlugin.cpp
#include "TestPluginPrivatePCH.h"
#include "TestPlugin.h"
void TestPluginImpl::StartupTestPlugin()
{
}
void TestPluginImpl::ShutdownTestPlugin()
{
}
bool TestPluginImpl::IsThisNumber42(int32 num)
{
return num == 42;
}
IMPLEMENT_MODULE(TestPluginImpl, TestPlugin)
。Uplugin 文件,查看模块名称,然后在testplugin.cpp中,查看这一行:
IMPLEMENT_MODULE(TestPluginImpl, TestPlugin)
我确定它们需要匹配。
例如:
"Modules" :
[
{
"Name" : "NebulaAudioAnalysisPlugin",
"Type" : "Runtime"
}
]
,我的实现看起来像:
IMPLEMENT_MODULE(FNebulaAudioAnalysisPlugin, NebulaAudioAnalysisPlugin)
相关文章:
- 尝试导入pybind-opencv模块时出现libgtk错误
- 无法通过空白将文本文件行分隔为矢量
- 为什么当我解模块化时,这个C++代代码"效率较低"?
- 如果C++对象的类在另一个boost模块中声明,如何使用boost将指向该对象的指针返回到python
- 内联如何影响模块接口中的成员函数
- 由cin中的字符串中未捕获空白引起的分割错误
- C++返回 Numpy 数组的 Python 扩展模块
- 当我尝试加载内核模块时,如何修复C++中的这个 malloc() 错误?
- 如何从线程中的不同模块调用函数?
- 如何使用 soong 命名空间来有条件地编译模块
- asn1c 不会从 asn.1 模块中提取八位字节字符串的默认值
- CMake - 模块 + 库混淆
- 特征 LLT 模块给出不正确的结果?
- 枚举进程模块在有效句柄上返回无效句柄
- 在 python 模块中导入子模块时PyImport_Import失败
- 尝试从 XamlApplication 编译 C++/WinRT 空白应用程序时,我收到未解析的外部符号 winrt_make_*
- 将 PCL 链接到 Cython C++ 模块
- 即使直接从官方示例中复制,也找不到未知类型名称QML_ELEMENT和 QML 模块
- 电源功能模块化操作
- 虚幻引擎4空白模块