ue4打包多模块

首先,每个模块,包含插件内的模块在内,都要用IMPLEMENT_MODULE(类名, 模块名)的方式,模块名就是带.build.cs的第一个单词。

build.cs里就说了这个模块该怎么用,用c#编写。

打包中要考虑到target.cs,将工程中相应的模块打包进去
uproject就要连插件和模块一起写进去

比如
在这里插入图片描述

这里,CoreOne和CoreTwo是工程里的多模块,myplugin和otherM是插件里的多模块。废话不多说,上代码

以工程中的一个模块CoreOne为例

coreOne.h

#pragma once

#include “CoreMinimal.h”
#include “Modules/ModuleManager.h”

class FCoreOneModule : public FDefaultGameModuleImpl
{
public:

/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;

};

coreone.cpp

#include “CoreOne.h”
#include “Modules/ModuleManager.h”

#define LOCTEXT_NAMESPACE “CoreOne”

void FCoreOneModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}

void FCoreOneModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FCoreOneModule, CoreOne);

coreone.build.cs
// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;

public class CoreOne : ModuleRules
{
public CoreOne(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine" });

	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
}

}
再以插件中的一个模块otherM为例
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
otherM.h
#pragma once

#include “CoreMinimal.h”
#include “Modules/ModuleManager.h”

class FOtherMModule : public IModuleInterface
{
public:

/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;

};

otherM.cpp
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

#include “OtherM.h”

#define LOCTEXT_NAMESPACE “OtherM”

void FOtherMModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}

void FOtherMModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FOtherMModule, OtherM)

otherM.build.cs
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class OtherM : ModuleRules
{
public OtherM(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

    PublicIncludePaths.AddRange(
		new string[] {
			// ... add public include paths required here ...
		}
		);
			
	
	PrivateIncludePaths.AddRange(
		new string[] {
			// ... add other private include paths required here ...
		}
		);
		
	
	PublicDependencyModuleNames.AddRange(
		new string[]
		{
			"Core",
			// ... add other public dependencies that you statically link with here ...
		}
		);
		
	
	PrivateDependencyModuleNames.AddRange(
		new string[]
		{
			"CoreUObject",
			"Engine",
			"Slate",
			"SlateCore",
			// ... add private dependencies that you statically link with here ...	
		}
		);
	
	
	DynamicallyLoadedModuleNames.AddRange(
		new string[]
		{
			// ... add any modules that your module loads dynamically here ...
		}
		);
}

}

同样myplugin模块也是如此
myplugin.h
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

#pragma once

#include “CoreMinimal.h”
#include “Modules/ModuleManager.h”

class FMyPluginModule : public IModuleInterface
{
public:

/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;

};

myplugin.cpp
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

#include “MyPlugin.h”

#define LOCTEXT_NAMESPACE “FMyPluginModule”

void FMyPluginModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}

void FMyPluginModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FMyPluginModule, MyPlugin)

加上一个蓝图能调用的类,用以测试

DllTask.h

#pragma once

#include “CoreMinimal.h”
#include “GameFramework/pawn.h”
#include “DllTask.generated.h”

/**
*
*/
UCLASS(Blueprintable, BlueprintType)
class MYPLUGIN_API ADllTask : public APawn
{
GENERATED_BODY()

public:
UFUNCTION(BlueprintCallable, Category = “Dll”)
void HelloDLL();
};

DllTask.cpp
#include “DllTask.h”
#include <Engine.h>
void ADllTask::HelloDLL()
{
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 200.0f, FColor::Blue, TEXT(“Hello Dll”));
}
}
PluginTest.Target.cs
// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

public class PluginTestTarget : TargetRules
{
public PluginTestTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;

	ExtraModuleNames.AddRange( new string[] { "PluginTest", "CoreOne", "CoreTwo" } );
}

}
PluginTestEditor.Target.cs
// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

public class PluginTestEditorTarget : TargetRules
{
public PluginTestEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;

	ExtraModuleNames.AddRange( new string[] { "PluginTest", "CoreOne", "CoreTwo" } );
}

}
PluginTest.uproject

{
“FileVersion”: 3,
“EngineAssociation”: “4.22”,
“Category”: “”,
“Description”: “”,
“Modules”: [
{
“Name”: “PluginTest”,
“Type”: “Runtime”,
“LoadingPhase”: “Default”
},
{
“Name”: “CoreOne”,
“Type”: “Runtime”,
“LoadingPhase”: “Default”
},
{
“Name”: “CoreTwo”,
“Type”: “Runtime”,
“LoadingPhase”: “Default”
}
],

“Plugins”: [
{
“Name”: “MyPlugin”,
“Enabled” : true
}
]
}

现在编辑器里试验下
设置默认地图为newmap
在这里插入图片描述
将dlltask拖进场景
在这里插入图片描述

打开关卡蓝图测试
在这里插入图片描述
运行正常
在这里插入图片描述
现在开始打包,先烘培
在这里插入图片描述
在这里插入图片描述
再打包64位windows
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
找到打包位置,双击打开
在这里插入图片描述
在这里插入图片描述
ok

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/555455.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Linux服务器磁盘满了如何清理

生产环境中&#xff0c;磁盘很容易被日志文件沾满&#xff0c;如何查找和清理呢&#xff1f; 分享一下个人的经验&#xff1a; 1.先查询到哪个磁盘占用的最多 使用命令&#xff1a;df -h 2.查询/目录下磁盘占用情况 使用命令&#xff1a;du -sh * 3.同理进入占用磁盘比较大…

聊聊binlog是什么

1. 上一讲思考題解答:redo日志刷盘策略的选择建议 先给大家解释一下上一讲的思考題&#xff0c;我给大家的一个建议&#xff0c;其实对于redo日志的三种刷盘策略&#xff0c;我们通常建议是设置为1 也就是说&#xff0c;提交事务的时候&#xff0c;redo日志必须是刷入磁盘文件…

接口测试之用Fiddler对手机app进行抓包

&#x1f525; 交流讨论&#xff1a;欢迎加入我们一起学习&#xff01; &#x1f525; 资源分享&#xff1a;耗时200小时精选的「软件测试」资料包 &#x1f525; 教程推荐&#xff1a;火遍全网的《软件测试》教程 &#x1f4e2;欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1…

基于FPGA的OMEGA东京奥运会计时器

截至2019年共举办了31届奥运会&#xff0c;其中27届的计时设备都由欧米茄&#xff08;OMEGA&#xff0c;Ω&#xff09;提供&#xff0c;今年的东京奥运会将会是第28届。 瑞士计时公司&#xff08;Swiss Timing&#xff09;基于火星Mars ZX2核心板打造了为奥运会等大型体育赛事…

Redis教程——数据类型(哈希、集合)

上篇文章我们学习了Redis教程——数据类型&#xff08;字符串、列表&#xff09;&#xff0c;这篇文章学习Redis教程——数据类型&#xff08;哈希表、集合&#xff09; 哈希表Hash 哈希表是一个string类型的field(字段)和value(值)的映射表&#xff0c;hash特别适合用于存储…

web轮播图

思路&#xff1a; 例如&#xff1a;有5张轮播的图片&#xff0c;每张图片的宽度为1024px、高度为512px.那么轮播的窗口大小就应该为一张图片的尺寸&#xff0c;即为&#xff1a;1024512。之后将这5张图片0px水平相接组成一张宽度为&#xff1a;5120px,高度依然为&#xff1a;5…

问题解决:pip install __命令安装不了Python库

项目环境&#xff1a; 我的环境&#xff1a;Window10&#xff0c;Python3.7&#xff0c;Anaconda3-2.4.0&#xff0c;Pycharm2023.1.3 问题描述①&#xff1a; pip install 命令安装不了需要的安装的Python库&#xff0c;以PyMuPDF为例 1 socket.timeout: The read operation t…

ICASSP 2024会议现场第四弹 晚会上韩风歌舞惊喜连连

会议之眼 快讯 在科技的浪潮中&#xff0c;ICASSP 2024会议作为全球信号处理领域的风向标&#xff0c;今日在充满活力韩国迎来了它的第五天日程&#xff01;会场中热烈的讨论和灵感迸发的交流&#xff0c;让会场仿佛成为一座思想的熔炉&#xff0c;不断燃烧着创新的火花&#…

2024经常用且免费的10个网盘对比,看看哪个比较好用!

网盘在我们的工作和学习中经常会用到&#xff0c;也是存储资料的必备工具&#xff0c;有了它&#xff0c;我们就不用走到哪都带着移动硬盘了&#xff0c;而目前市场上的主流网盘还有数十款&#xff0c;其中有免费的也有付费的&#xff0c;各家不一&#xff0c;今天小编就来为您…

ins视频批量下载,instagram批量爬取视频信息【爬虫实战课1】

简介 Instagram 是目前最热门的社交媒体平台之一,拥有大量优质的视频内容。但是要逐一下载这些视频往往非常耗时。在这篇文章中,我们将介绍如何使用 Python 编写一个脚本,来实现 Instagram 视频的批量下载和信息爬取。 我们使用selenium获取目标用户的 HTML 源代码,并将其保存…

Unity解决:导出安卓apk 安装时报错:应用未安装:软件包似乎无效

Unity2018.4.36 导出安卓apk 安装时报错&#xff1a;应用未安装&#xff1a;软件包似乎无效 解决办法&#xff1a;因为安装到安卓12 需要添加添加过滤规则 在AS工程AndroidManifest.xml 添加过滤规则即可。 android:exported"true"

爬虫 | 网易新闻热点数据的获取与保存

Hi&#xff0c;大家好&#xff0c;我是半亩花海。本项目是一个简单的网络爬虫&#xff0c;用于从网易新闻的热点新闻列表中提取标题和对应的链接&#xff0c;并将提取到的数据保存到一个 CSV 文件中。 目录 一、技术栈 二、功能说明 三、注意事项 四、代码解析 1. 导入所需…

[天梯赛] 图上的动态规划与Dijkstra

题目 刚开始的思路 一开始是想到了要用Dijkstra&#xff0c;但是不知道如何找到多条路径的信息&#xff08;刚开始是想把所有最短路找到之后再比较找到最大的救援队数量&#xff09; 正确的思路 在Dijkstra的过程中&#xff0c;分两种情况&#xff1a; 找到更短路径进行更新…

geolife笔记/python笔记:trackintel.io.read_geolife

此函数解析 geolife_path 目录中可用的所有 geolife 数据 trackintel.io.read_geolife(geolife_path, print_progressFalse) 参数&#xff1a; geolife_path (str) 包含 geolife 数据的目录路径 print_progress (Bool, 默认为 False)如果设置为 True&#xff0c;则显示每个…

【python从入门到精通】-- 第五战:函数大总结

&#x1f308; 个人主页&#xff1a;白子寰 &#x1f525; 分类专栏&#xff1a;python从入门到精通&#xff0c;魔法指针&#xff0c;进阶C&#xff0c;C语言&#xff0c;C语言题集&#xff0c;C语言实现游戏&#x1f448; 希望得到您的订阅和支持~ &#x1f4a1; 坚持创作博文…

js BOM模型常用方法梳理

1、Bom定义 BOM是操作浏览器的模型&#xff0c;主要是对浏览器的一些操作。 2、获取浏览器窗口的尺寸 window.innerHeight:获取窗口的高度。 window.innerWidth:湖区窗口的宽度&#xff0c;只在window浏览器下使用。 3、弹出层 alert:弹出框。 confirm:确认框。返回值有true …

Redis中的Lua脚本(三)

Lua脚本 EVAL命令的实现 EVAL命令的执行过程可以分为以下三个步骤: 1.根据客户端给定的Lua脚本&#xff0c;在Lua环境中定义一个Lua函数2.将客户端给定的脚本保存到lua_scripts字典&#xff0c;等待将来进一步使用3.执行刚刚在Lua环境中定义的函数&#xff0c;以此来执行客户…

2.核心概念与安装配置

核心概念与安装配置 文章目录 核心概念与安装配置1、核心概念Docker整体架构及底层通信原理 2、安装DockerCentos安装Docker引擎阿里云镜像加速Docker run的过程 3、Docker相关命令 1、核心概念 镜像&#xff08;image&#xff09; Docker 镜像&#xff08;Image&#xff09;就…

Linux 搭建私有yum源仓库

一、环境准备 IP系统版本作用192.168.140.155CentOS 7.9.2009yum源仓库192.168.140.153CentOS 7.9.2009测试 准备两台服务器&#xff0c;一台作为yum源仓库&#xff0c;另一台作为测试使用。 二、搭建yum源服务器 &#xff08;无法连接外网的情况&#xff0c;需要去官网下载镜…

ssm058基于Java的共享客栈管理系统+jsp

共享客栈管理系统的设计与实现 摘 要 互联网发展至今&#xff0c;无论是其理论还是技术都已经成熟&#xff0c;而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播&#xff0c;搭配信息管理工具可以很好地为人们提供服务。针对房屋出租信息管理混乱&#xff0c;出…
最新文章