UE4->Plugin 认识UE4插件 2_ueplus-程序员宅基地

技术标签: UE4  UE4 Plugin  UE4 插件  

原创文章,转载请注明出处。

本文介绍 两个知识点Plugin/Module 插件和模块的联系区别,同时介绍插件和我们的Source中创建多模块。

**

一、Plugin/Module 插件和模块的联系区别

**
1> 一个插件至少有一个模块
2>一般插件都是做底层做通用设计的,而模块做的负责的我理解为逻辑

ProjectName.Build.cs		//主要管理的是链接, dll的链接
ProjectName.Target.cs		//管理的是编译,加上才会编译你的Module, 如果你是runtime模块,放到这里
ProjectName.Editor.Target.cs	//管理的是编译,加上才会编译你的Module, 如果你的是editor模块,那么好,放这里

关于.Build.cs中的一些介绍

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

PrivateDependencyModuleNames.AddRange(new string[] {
      });
PublicDependencyModuleNames 里面的所有模块都会被引用该模块的模块所继承使用,你就理解成public
PrivateDependencyModuleNames 与上面相反了,按private理解

二、在Plugin中创建多模块以及在我们的Source中创建多模块

1>我的SelectDialog插件,放置三个模块。如下图
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2>在你的Plugin中加上你的模块引用,如下图
在这里插入图片描述
3>加上模块中的 StartupModule和ShutdownModule可以在模块初始化和模块卸载时增加你的业务逻辑,如下图

头文件.h

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "ISlateFileDialogModuleEx.h"

class FSlateFileDialogsStyle;

class FSlateFileDialogsModule : public ISlateFileDialogsModule
{
    
public:

	// IModuleInterface interface

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

public:
	//ISlateFileDialogModule interface

	bool OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex);

	bool OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames);

	bool OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		FString& OutFoldername);

	bool SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames);

	ISlateFileDialogsModule* Get();

	FSlateFileDialogsStyle *GetFileDialogsStyle() {
     return FileDialogStyle; }

private:
	ISlateFileDialogsModule *SlateFileDialog;

	FSlateFileDialogsStyle	*FileDialogStyle;
};

实现.cpp

// Copyright Epic Games, Inc. All Rights Reserved.

#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "SlateFileDialogsEx.h"
#include "SlateFileDialogsStylesEx.h"
#include "SlateFileDlgWindowEx.h"

void FSlateFileDialogsModule::StartupModule()
{
    
	SlateFileDialog = new FSlateFileDialogsModule();

	FileDialogStyle = new FSlateFileDialogsStyle;
	FileDialogStyle->Initialize();
}


void FSlateFileDialogsModule::ShutdownModule()
{
    
	if (SlateFileDialog != NULL)
	{
    
		FileDialogStyle->Shutdown();
		delete FileDialogStyle;

		delete SlateFileDialog;
		SlateFileDialog = NULL;
	}
}


bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex)
{
    
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames, OutFilterIndex);
}


bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{
    
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}


bool FSlateFileDialogsModule::OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
		FString& OutFoldername)
{
    
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.OpenDirectoryDialog(ParentWindowHandle, DialogTitle, DefaultPath, OutFoldername);
}


bool FSlateFileDialogsModule::SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
	const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
{
    
	FSlateFileDlgWindow dialog(FileDialogStyle);
	return dialog.SaveFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
}


ISlateFileDialogsModule* FSlateFileDialogsModule::Get()
{
    
	return SlateFileDialog;
}

IMPLEMENT_MODULE(FSlateFileDialogsModule, SlateFileDialogsEx);

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011718663/article/details/115877599

智能推荐

android WebView加载html 并 引用本地资源(图片、字体库)_android html 使用本地图片-程序员宅基地

文章浏览阅读1.2w次。本文介绍如何用android WebView加载html代码,并在html内引用apk里的资源文件,例如图片、字体库等。先说一般情况,文件夹有html、ttf字库、图片html代码如下: .text { font-family: STANK; font-size:60px;} @font-face {_android html 使用本地图片

算法:分治+floyd_计蒜之道复赛A题 百度地图的实时路况_分治 floyd-程序员宅基地

文章浏览阅读840次。一开始使用枚举来Floyd最短路计算,复杂度O(n^4),超时,确实没招,搜答案,发现了:http://blog.csdn.net/miracle_ma/article/details/51817109http://blog.csdn.net/shinfeb/article/details/51816142看了半天才整明白,其思想是减少不必要的重复计算,Floyd是将每个点依次_分治 floyd

Spring Boot各版本的Java版本要求_springboot2.3.xjdk要求-程序员宅基地

文章浏览阅读5.3k次。Spring Boot 与 Java 对应版本,以下表格由官方网站总结。官网:https://spring.io/projects/spring-boot#learnhttps://docs.spring.io/spring-boot/docs/{verion}/reference/htmlsingle/Go to [9. System Requirements]Sping Bo..._springboot2.3.xjdk要求

python中常见的内置模块_python的内置模块有哪些-程序员宅基地

文章浏览阅读2.2k次。模块在python中,一个.py文件就是一个模块(xxx.py)。通过创建者对模块进行分类:1.python的内置模块 random os os.path2.需要自己安装的第三方模块3.自定义模块导入模块的方式:1.import 模块名字2.import 模块名字 as 别名使用模块中的内容:from......import......一、random模块randint:产生随机数[x,y]random:产生0-1之间的随机数uniform:产生正态分_python的内置模块有哪些

android sdk 固态硬盘,使用TVM在android中进行Mobilenet SSD部署-程序员宅基地

文章浏览阅读390次。所谓TVM,按照正式说法:就是一种将深度学习工作负载部署到硬件的端到端IR(中间表示)堆栈。换一种说法,可以表述为一种把深度学习模型分发到各种硬件设备上的、端到端的解决方案,关于更多TVM的信息大家可以参考TVM主页。首发:https://zhuanlan.zhihu.com/p/70982338作者:张新栋我们在端上进行CNN部署的时候,为了最大化的发挥硬件的性能,之前的框架多是用的手工调优的算..._android 挂接 ssd硬盘

计算机信息管理系统基础知识,信息系统基础知识-程序员宅基地

文章浏览阅读563次。信息系统是由计算机硬件、网络和通讯设备、计算机软件、信息资源、信息用户和规章制度组成的以处理信息流为目的的人机一体化系统。以下是由学习啦小编整理关于信息系统基础知识的内容,希望大家喜欢!信息系统的定义是一个由人、计算机及其他外围设备等组成的能进行信息的收集、传递、存贮、加工、维护和使用的系统。它是一门新兴的科学,其主要任务是最大限度的利用现代计算机及网络通讯技术加强企业的信息管理,通过对企业拥有的..._计算机信息管理完成基础是什么

随便推点

make: *** /lib/modules/3.10.0-1160.el7.x86_64/build: No such file or directory. Stop.-程序员宅基地

文章浏览阅读8.2k次,点赞4次,收藏26次。这个问题应该是系统没有安装内核开发包,[root@localhost /]# cd /lib/modules/3.10.0-1160.el7.x86_64/[root@localhost 3.10.0-1160.el7.x86_64]# lltotal 3308lrwxrwxrwx. 1 root root 39 Jan 1 09:15 build -> /usr/src/kernels/3.10.0-1160.el7.x86_64drwxr-xr-x. 3 root root_make: *** /lib/modules/3.10.0-1160.el7.x86_64/build: no such file or directo

(二)百度AI 开放平台API调用之AccessToken的获取_百度开放平台申请access_token-程序员宅基地

文章浏览阅读1.6w次。近来要了解自然语言处理方面的技术,拿百度API做个实验对,进行多次编码尝试最终成功调用。在本人博客百度API使用系列,使用python代码实现。涉及内容如下:AccessToken获取自然语言API调用,代码参数设置代码修改中出现的错误,及最终的方法 错误提示:"error_code": 282004,error_msg":"invalid parameter(s)" not a vali..._百度开放平台申请access_token

异步网络模块之aiohttp的使用(一)-程序员宅基地

文章浏览阅读1.9k次。异步网络模块之aiohttp的使用(一)平时我们也许用的更多的是requests模块,或者是requests_hml模块,但是他们都属于阻塞类型的不支持异步,速度很难提高,于是后来出现了异步的grequests,开始了异步网络请求,速度得到了大大的提升,但是今天我们要说的另外的一个比较异步网络请求模块-aiohttp。什么是aiohhtp?要学习一个模块,首先要知..._aiohttp verify

Windows 任务计划程序定时执行 powershell 脚本_windows定时任务自动执行ps1脚本-程序员宅基地

文章浏览阅读3.3w次,点赞3次,收藏14次。由于需要进行一些特殊操作,打算使用 powershell 来写脚本,需要Windows 任务计划程序定时执行。做一个简单测试:本地拷贝一个文件到其他盘中创建文件: aa.txt创建powershell 执行脚本:test.ps1脚本内容:Copy-Item D:\aa.txt E:\如图:ps1 脚本默认是禁止执行的:#查看当前PS中脚本_windows定时任务自动执行ps1脚本

给android模拟器安装虚拟SD卡_android 模拟器中不支持的虚拟 sd 卡 mac-程序员宅基地

文章浏览阅读1.8k次。1.首先创建一个模拟器AVD2.建立存储镜像: mksdcard 1024MB(SD卡大小根据个人喜好来定) sdcard.iso3.带参数的启动模拟器:在cmd命令中输入 emulator -avd avdname(你的模拟器名) -sdcard filename.iso 例如 emulator -avd android1.6(你的模拟器名) -sdcard sdcard.iso (刚刚你建立的那个sd卡镜像)【或者eclipse里面直接启动】在eclipse里面的话就需要在你的运行配置文件夹对话框里面给_android 模拟器中不支持的虚拟 sd 卡 mac

Oracle GoldenGate安装配置教程_oracle goldengate12.3安装教程-程序员宅基地

文章浏览阅读773次。Oracle GoldenGate安装配置教程(2012-12-12 21:00:00)转载▼标签:it分类:ORACLE1 简介Oracle Golden Gate软件是一种基于日志的结构化数据复制备份软件,它通过解析源数据库在线日志或归档日志获得数据的增量变化,再将这些变化应用到目标数据库,从而实现源数_oracle goldengate12.3安装教程