ue4打包多模块

news2024/9/21 16:30:30

首先,每个模块,包含插件内的模块在内,都要用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.coloradmin.cn/o/1597057.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

go语言并发实战——日志收集系统(一) 项目前言

-goroutine- 简介 go并发编程的练手项目 项目背景 一般来说业务系统都有自己的日志,当系统出现问题时,我们一般需要通过日志信息来定位与解决问题&#xff0c;当系统机器较少时我们可以登录服务器来查看,但是当系统机器较多时,我们通过服务器来查看日志的成本就会变得很大,…

leetcode刷题日记之全排列

题目描述 题目解释 这个题类似于之前做的某一道题&#xff0c;其实算法还是要追踪到树的深度遍历&#xff0c;相当于便利叶子节点的路径记录。不过递归的过程就相当于件数根据树进行遍历了。 代码如下 class Solution:def permute(self, nums: List[int]) -> List[List[i…

电动汽车原理视频笔记

看到了一个讲的不错的系列视频 新能源维修猿老罗的个人空间-新能源维修猿老罗个人主页-哔哩哔哩视频 道路千万条&#xff0c;安全第一条&#xff01;新能源维修高压安全知识以及维修工具介绍_哔哩哔哩_bilibili 那么简单&#xff01;电动汽车高压配电和控制_哔哩哔哩_bilibili…

EasyRecovery数据恢复软件2024百度云网盘下载链接

EasyRecovery数据恢复软件是一款功能强大的数据恢复工具&#xff0c;它能够帮助用户从各种存储设备中恢复丢失或误删除的文件数据。无论是由于意外删除、格式化、病毒攻击还是其他原因导致的数据丢失&#xff0c;EasyRecovery都能提供有效的解决方案。 该软件支持多种存储介质…

创维:在博鳌论坛 叩响世界之门

出走半生&#xff0c;归来仍是少年。 2024年4月8日&#xff0c;一个离开海南近半个世纪的“少年”回到琼海博鳌&#xff0c;“下一站&#xff0c;1000亿&#xff01;”&#xff0c;他的承诺掷地有声。“1000亿”&#xff0c;意指创维集团在2025年前冲击千亿营收&#xff0c;这…

选课成绩管理系统

文章目录 员工管理系统一、项目演示二、项目介绍三、系统部分功能截图四、部分代码展示五、底部获取项目&#xff08;9.9&#xffe5;&#xff09; 员工管理系统 一、项目演示 课程管理系统 二、项目介绍 基于springbootvue的前后端分离选课成绩管理系统 该系统可做课程管理…

【Java开发指南 | 第九篇】访问实例变量和方法、继承、接口

专栏&#xff1a;Java开发指南 CSDN秋说 文章目录 访问实例变量和方法继承接口 访问实例变量和方法 通过已创建的对象来访问成员变量和成员方法&#xff0c;如下所示&#xff1a; /* 实例化对象 */ Object referenceVariable new Constructor(); /* 访问类中的变量 */ refer…

【视频异常检测】Learning Multimodal Violence Detection under Weak Supervision 论文阅读

Not only Look, but also Listen: Learning Multimodal Violence Detection under Weak Supervision 论文阅读 Abstract1 Introduction2 Related Work3 XD-Violence Dataset3.1 Selecting Violence Categories3.2 Collection and AnnotationVideo annotation.3.3 Dataset Stati…

如何下载Plugin Registration Tool

今天给大家演示一下如何使用Power Platform CLI来下载Plugin Registration Tool. 前提条件 本地需要安装.net 1. 下载并安装Power Platform CLI 可以在VS Code的Terminal中使用powershell或者直接在cmd中运行下面的命令&#xff1a; dotnet tool install --global Microsof…

【华为OD机试】围棋的气【C卷|100分】

题目描述 围棋棋盘由纵横各19条线垂直相交组成,棋盘上一共19 x 19 = 361 个交点, 对弈双方一方执白棋,一方执黑棋,落子时只能将棋子置于交点上。 “气”是围棋中很重要的一个概念,某个棋子有几口气,是指其上下左右方向四个相邻的交叉点中, 有几个交叉点没有棋子,由此可…

2024-04-15_[UPnP]:详细解析

UPnP 一、论文阅读 1.2 Theory 1.2.1 Geometry of the absolute pose problem α i f i v i R p i t , i 1.. n . \alpha_i \mathbf{f}_i \mathbf{v}_i \mathbf{R} \mathbf{p}_i \mathbf{t} ,i1..n. αi​fi​vi​Rpi​t,i1..n. 其中&#xff1a; P i ∈ R 3 P_i \i…

rhce day1

一 . 在系统中设定延迟任务要求如下 在系统中建立 easylee 用户&#xff0c;设定其密码为 easylee 延迟任务由 root 用户建立 要求在 5 小时后备份系统中的用户信息文件到 /backup 中 确保延迟任务是使用非交互模式建立 确保系统中只有 root 用户和 easylee 用户可以执行延…

直播平台主播的美颜功能是如何实现的?美颜SDK技术深度解析

时下&#xff0c;直播平台的美颜SDK则扮演着至关重要的角色。接下来&#xff0c;我们将深入探讨直播平台主播美颜功能的实现原理&#xff0c;以及美颜SDK技术的应用。 一、美颜技术的发展 随着人工智能和计算机视觉技术的不断进步&#xff0c;美颜技术逐渐实现了更加智能化的…

如何在横向渗透攻击中寻到一线生机

横向渗透&#xff0c;作为计算机网络中的一种攻击技术&#xff0c;展现出了攻击者如何巧妙地利用同一级别系统间的漏洞和弱点&#xff0c;扩大其网络访问权限。与纵向渗透不同&#xff0c;横向渗透不关注权限的垂直提升&#xff0c;而是更侧重于在同一层级内扩展影响力。 横向…

Problem #8 [Easy]

This problem was asked by Google. A unival tree (which stands for “universal value”) is a tree where all nodes under it have the same value. Given the root to a binary tree, count the number of unival subtrees. For example, the following tree has 5 un…

强烈推荐 ——电脑终端管理系统

强烈推荐&#xff01;电脑终端管理系统 电脑终端管理系统使用的目的是为了管控电脑上硬件和软件资产&#xff0c;以及员工使用电脑的行为&#xff0c;最终目的是为了保护企业资产和信息&#xff0c;以下是一些推荐的电脑终端管理系统&#xff0c;这些系统为企业提供了强大的功…

OpenHarmony南向开发案例:【智能体重秤】

一、简介 本demo基于OpenHarmony3.1Beta版本开发&#xff0c;该样例能够接入数字管家应用&#xff0c;通过数字管家应用监测体重秤上报数据&#xff0c;获得当前测量到的体重&#xff0c;身高&#xff0c;并在应用端形成一段时间内记录的体重值&#xff0c;以折线图的形式表现…

破译验证码reCAPTCHA 之 打码平台

由于登录需要验证码&#xff0c;除了日常的字符串&#xff0b;数字&#xff0c;此时就需要用第三方插件进行破译。 reCaptcha是Google公司的验证码服务&#xff0c;方便快捷&#xff0c;改变了传统验证码需要输入n位失真字符的特点。 1. reCAPTCHA 初识 reCaptcha是Google公司…

FMEA分析

目录 1、FMEA的核心目的 2、FMEA的种类 3、FMEA的实施步骤 4、FMEA的SOD等级 5、FMEA的例子 FMEA&#xff08;Failure Modes and Effects Analysis&#xff0c;失效模式与影响分析&#xff09;是一种预防性的可靠性设计分析&#xff0c;用来确定潜在失效模式及其原因。它主…

Python数据可视化库—Bokeh与Altair指南【第161篇—数据可视化】

&#x1f47d;发现宝藏 前些天发现了一个巨牛的人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;忍不住分享一下给大家。【点击进入巨牛的人工智能学习网站】。 在数据科学和数据分析领域&#xff0c;数据可视化是一种强大的工具&#xff0c;可以帮助我们…