ue4安装插件_ue4 软引用

ue4安装插件_ue4 软引用原创文章,转载请注明出处。本文介绍两个知识点Plugin/Module插件和模块的联系区别,同时介绍插件和我们的Source中创建多模块。**一、Plugin/Module插件和模块的联系区别**1>一个插件至少有一个模块2>一般插件都是做底层做通用设计的,而模块做的负责的我理解为逻辑ProjectName.Build.cs //主要管理的是链接,dll的链接ProjectName.Target.cs //管理的是编译,加上才会编译你的Module,如果你是run

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

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

本文介绍 两个知识点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);

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/186104.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Clover 引导 Windows 及 Linux 双系统

    Clover引导Windows及Linux双系统UEFIcnblogs@Orcim  此文比较详细地介绍了通过修改Clover的配置文件,添加Clover启动项的方法(添加Ubuntu启动项)。此文阅读前提,假定你已经完成安装Clover至硬盘EFI分区,Ubuntu已安装。为什么是CLOVER引导?一方面,…

    2022年4月7日
    586
  • LockWorkStation in Windows 9X/ME/NT/2000

    LockWorkStation in Windows 9X/ME/NT/2000LockWorkStationinWindows9X/ME/NT/2000代码作者:Delphiscn(cnBlaster#sohu.com)http://blog.csdn.net/delphiscn程序原码:http://blog.csdn.net/delphiscn/archive/2005/06/25/403157.aspx在线下载:http://de1phiscn.bokee….

    2022年7月21日
    17
  • Java 初中级程序员如何快速成长?

    Java 初中级程序员如何快速成长?入职后如何快速成长到CTO入职后三个月试用期要做的事三法宝,处理同事关系核心两点,处理好领导关系每件事都是学习的机会主动加班,试用期加班是学习的好机会未通过试用期,如何应对?前三年需要学的技术工作后,千万不要停止学习项目经验如何累积?JAVA高级技术还需要学习哪些?架构师课程如何学习?工作中,快速学习新技术的捷径(重要的是形成体系,而不是钻到某个技术点)…

    2022年6月9日
    25
  • java random.nextInt的坑

    java random.nextInt的坑下面的代码Randomrandom=newRandom();Integercode=random.nextInt(len);很简单的两句代码,需要注意两点:第一:nextInt的取值是[0,n),不包括n。如果是随机list,直接传list的size,不用担心下标越界。api说明:Returnsapseudorandom,uniformly

    2022年7月22日
    11
  • 各种获取设备唯一标识的方法介绍

    各种获取设备唯一标识的方法介绍一.UDID(UniqueDeviceIdentifier)UDID的全称是UniqueDeviceIdentifier,它就是苹果iOS设备的唯一识别码,它由40位16进制数的字母和数字组成(越狱的设备通过某些工具可以改变设备的UDID)。移动网络可利用UDID来识别移动设备,但是,从IOS5.0(2011年8月份)开始,苹果宣布将不再支持用uniqueIdentifier方法获

    2022年7月11日
    19
  • c语言入门教程–-11递归

    c语言入门教程–-11递归

    2021年3月12日
    306

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号