当前位置: 首页 > news >正文

智能网站建设网站备案 公司名称关联性

智能网站建设,网站备案 公司名称关联性,做配件出口上什么网站,西安市城乡建设网官方网站本篇博文介绍了#xff0c;如果在UE 中如何使用第三方库#xff0c;及制作成插件的方法。 DLL 文件是上篇文章中创键的具体的方法见上篇文章。下面开始介绍方法 首先#xff0c;创建一个空白的 UE5 C 项目#xff0c;然后再创建一个空白内容的插件#xff0c;如下图所示 …本篇博文介绍了如果在UE 中如何使用第三方库及制作成插件的方法。 DLL 文件是上篇文章中创键的具体的方法见上篇文章。下面开始介绍方法 首先创建一个空白的 UE5 C 项目然后再创建一个空白内容的插件如下图所示 修改UeWllApi.uplugin 里面的内容 如下图所示 在 插件的文件夹中 添加文件夹及DLL,LIB,.H 文件注意具体的路径不要错否则可能插件制作不成功如下图所示 首先在插件中添加一个ThridParty的文件夹文件夹名字不要错如下图所示 然后在ThridParty 内再添加一个文件夹WllApi如下图所示 然后在 WllApi 里面添加三个文件夹 bin,inc,lib(名字不要错)如下图所示 然后再bin ,lib分别添加x64 文件夹 inc 里面添加WllApi 文件夹 如下图所示 然后再bin ,lib,的x64文件夹下添加 Debug,Release 文件夹然后在Debug,Release 里面添加对应的Dll ,lib文件在inc 里面的WllApi文件夹下添加需要的头文件.如下图所示 在 插件的的Build.cs UeWllApi.Build.cs中添加以下代码 // Copyright Epic Games, Inc. All Rights Reserved. using System.IO; using UnrealBuildTool;public class UeWllApi : ModuleRules {public UeWllApi(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 ... Projects});DynamicallyLoadedModuleNames.AddRange(new string[]{// ... add any modules that your module loads dynamically here ...});LoadPlugins(Target);}public void LoadPlugins(ReadOnlyTargetRules Target){bool bSupport false;string BinPath , LibPath ;//初始化BIN,LIB路径为空string PluginPath Path.Combine(ThridParty, WllApi);PrivateIncludePaths.Add(Path.Combine(PluginDirectory,PluginPath,inc));if(Target.PlatformUnrealTargetPlatform.Win64){if(Target.ConfigurationUnrealTargetConfiguration.Debug){BinPath Path.Combine(PluginPath, bin, x64, Debug);LibPath Path.Combine(PluginPath, lib, x64, Debug);}else{BinPath Path.Combine(PluginPath, bin, x64, Release);LibPath Path.Combine(PluginPath, lib, x64, Release);}bSupport true;}if(bSupport){PublicAdditionalLibraries.Add(Path.Combine(PluginDirectory, LibPath, FirstDll.lib));PublicDelayLoadDLLs.Add(FirstDll.dll);RuntimeDependencies.Add(Path.Combine($(PluginDir), BinPath, FirstDll.dll));}} } 还有要注意添加 “Projects” 模块 具体结果如下图所示 在UeWllApi.h中添加以下代码如下图所示 public :static constexpr wchar_t* ModuleName{ LUeWllApi };//插件的名字 public:/** IModuleInterface implementation */virtual void StartupModule() override;virtual void ShutdownModule() override; public:static FName GetModularFeatureName(){static FName FeatureName FName(ModuleName);return FeatureName;}static inline IModuleInterface Get(){return FModuleManager::LoadModuleCheckedIModuleInterface(ModuleName);}static inline bool IsAvailable()//是否可以获得{return FModuleManager::Get().IsModuleLoaded(ModuleName);} private:FString GetLibaryPath();void* LibraryHandle nullptr;在UeWllApi.cpp中添加以下代码如下图所示 #include UeWllApi.h #includeMisc/MessageDialog.h//消息框头文件 #include Interfaces/IPluginManager.h//插件管理头文件 #define LOCTEXT_NAMESPACE FUeWllApiModulevoid FUeWllApiModule::StartupModule() {FString LibraryPath GetLibaryPath();LibraryHandle LibraryPath.IsEmpty() ? nullptr : FPlatformProcess::GetDllHandle(*LibraryPath);//当前的路径是否为空不为空的话获取句柄if (!LibraryHandle){FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(ThridPartyLibraryError, Failed to load WllApi Library));} }void FUeWllApiModule::ShutdownModule() {FPlatformProcess::FreeDllHandle(LibraryHandle);//释放句柄LibraryHandle nullptr; } FString FUeWllApiModule::GetLibaryPath() {FString BaseDir IPluginManager::Get().FindPlugin(ModuleName)-GetBaseDir();//寻找插件FString LibraryPath; #if PLATFORM_WINDOWS # if PLATFORM_64BITS # if UE_BUILD_DEBUGLibraryPath FPaths::Combine(*BaseDir, TEXT(ThridParty/WllApi/bin/x64/Debug/FirstDll.dll)); # elseLibraryPath FPaths::Combine(*BaseDir, TEXT(ThridParty/WllApi/bin/x64/Release/FirstDll.dll)); # endif # else # if UE_BUILD_DEBUGLibraryPath FPaths::Combine(*BaseDir, TEXT(ThridParty/WllApi/bin/x86/Debug/FirstDll.dll)); # elseLibraryPath FPaths::Combine(*BaseDir, TEXT(ThridParty/WllApi/bin/x86/Release/FirstDll.dll)); # endif # endif #endifreturn LibraryPath;} #undef LOCTEXT_NAMESPACEIMPLEMENT_MODULE(FUeWllApiModule, UeWllApi)添加C类型的Blueprint Function Library如下图所示运行时是插件 在UeWllApiFunctionLibrary.h 添加以下代码如下图所示 public:UFUNCTION(BlueprintCallable,CategoryUeWllApi)static int GetSum();在UeWllApiFunctionLibrary.cpp 添加以下代码 如图所示 int UUeWllApiFunctionLibrary::GetSum() {return sum(3,4); } 到此为止插件就制作完成了只要打包调用就可以了可以看到在本程序内可以调用结果也正确 打包出来在其他程序调用也正确结果如下图所示
http://www.zqtcl.cn/news/633008/

相关文章:

  • 全国住房城乡建设厅网站wordpress 宽版
  • 网站建设实训意见中国建设人才信息网站
  • 如何给网站做301跳转中国做机床的公司网站
  • 网站建设课程体系济南建站详情
  • jsp网站空间网站开发北京 广告 手机网站
  • 郑州网站建设推广爱站网seo综合查询工具
  • 2017年网站开发用什么语言手游排行榜
  • 鞍山百度网站怎么制作建设部网站建造师公示
  • 建设部网站业绩补录营销型网站制作的方法
  • 建设网站的功能及目的是什么意思兰州网络优化seo
  • 用ps软件做ppt模板下载网站有哪些内容广州seo服务外包
  • 毕业设计论文网站开发需要多少湛江建站免费模板
  • 做豆制品的网站集团网站建设策划方案
  • 燕郊网站制作哈尔滨企业网站建站推荐
  • 本地网站做通用会员卡建立电子商务网站目的
  • ftp网站地图怎么做网站模板出售
  • 用rp怎么做网站导航菜单手机app制作入门教程
  • 国外创意网站市场营销在线课程
  • 怎么做点图片链接网站网站建设云解析dns有什么用
  • 重庆网站建设哪家公司哪家好企业 网站规划与网页设计word
  • 手机必备软件100个网站建设和优化排名
  • 天津公司网站怎样制作网页设计图片尺寸
  • 网站建设中模板代码网络营销推广公司哪家好
  • 百度免费建立网站搜索引擎推广效果
  • 网站建设分金手指排名十二建设内容管理网站的目的
  • 无锡网站策划制作网站的工具
  • 免费的网站开发软件百度做网站推广的费用
  • 汽车维修东莞网站建设怎么用阿里的域名 做网站
  • 网站怎么做免费cosy WordPress
  • wordpress 关闭自动更新青岛济南网站建设优化