中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

金品誠企網(wǎng)站建設(shè)b站2023年免費入口

金品誠企網(wǎng)站建設(shè),b站2023年免費入口,免費域名空間服務(wù),幼兒園網(wǎng)站模板免費下載0,前言 我看的是 技術(shù)宅阿棍兒 的視頻,B站有。 系列視頻:從代碼引用插件_嗶哩嗶哩_bilibili 看不懂,只能邊查資料邊看,講的順序有點亂 1,根據(jù)視頻提示創(chuàng)建第三方插件 注意:如果只有空白插件的情…

0,前言

我看的是?技術(shù)宅阿棍兒 的視頻,B站有。

系列視頻:從代碼引用插件_嗶哩嗶哩_bilibili

看不懂,只能邊查資料邊看,講的順序有點亂

1,根據(jù)視頻提示創(chuàng)建第三方插件?

注意:如果只有空白插件的情況,需要你創(chuàng)建一個C++類,就能夠看到很多插件類型了

具體看著:Creating New Plugins - non-content only - missing templates? - #3 by JollyTarkaVFX - C++ - Epic Developer Community Forums?(將這個插件放在了ue引擎或者選擇放在項目下面,建議后者)

2,創(chuàng)建游戲模式

可以參考以下文章,很簡單,就看前面的兩步就OK:?(以下過程會讓你的UE不斷重啟)

???????UE4開發(fā)三:創(chuàng)建游戲模式、角色、控制器_mergerly的博客-CSDN博客_ue4玩家控制器游戲模式作用

然后你會擁有如下的文件結(jié)構(gòu):

新建工程下的目錄:

介紹一下文件結(jié)構(gòu)和調(diào)用關(guān)系是:

???????第三方插件調(diào)用第三方庫?

3,創(chuàng)建第三方插件的類:

(1)按照圖上的步驟來:???????

???????

???????

最后,打開vs,重啟就行

4,第三方插件的代碼修改?

(1)修改ThirdLibInvoker類的代碼

ThirdLibInvoker.h

class MYTHIRDPLUGIN2_API UThirdLibInvoker : public UObject
{GENERATED_BODY()void* ExampleLibraryHandle;public:~UThirdLibInvoker();void InvokeLib();
};

ThirdLibInvoker.cpp

(這里其實是將MyThirdPlugin2.cpp的代碼拷貝過來,憋看到就害怕了~)

// Fill out your copyright notice in the Description page of Project Settings.#include "ThirdLibInvoker.h"
#include "Core.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/IPluginManager.h"
#include "MyThirdPlugin2Library/ExampleLibrary.h"UThirdLibInvoker::~UThirdLibInvoker()
{FPlatformProcess::FreeDllHandle(ExampleLibraryHandle);ExampleLibraryHandle = nullptr;
}void UThirdLibInvoker::InvokeLib()
{if (ExampleLibraryHandle == nullptr){// Get the base directory of this pluginFString BaseDir = IPluginManager::Get().FindPlugin("MyThirdPlugin2")->GetBaseDir();// Add on the relative location of the third party dll and load itFString LibraryPath;
#if PLATFORM_WINDOWSLibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/MyThirdPlugin2Library/Win64/ExampleLibrary.dll"));
#elif PLATFORM_MACLibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/MyThirdPlugin2Library/Mac/Release/libExampleLibrary.dylib"));
#elif PLATFORM_LINUXLibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/MyThirdPlugin2Library/Linux/x86_64-unknown-linux-gnu/libExampleLibrary.so"));
#endif // PLATFORM_WINDOWSExampleLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;if (ExampleLibraryHandle){// Call the test function in the third party library that opens a message boxExampleLibraryFunction();}else{//FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load example third party library"));}}}

??(2)修改MyThirdPlugin2的代碼

MyThirdPlugin2.h

刪掉:void * exemplexxxx(具體啥名字忘記了)

加上:class UThirdLibInvoker * Lib;

MyThirdPlugin2.cpp

void FMyThirdPlugin2Module::StartupModule()
{// 將這些代碼復(fù)制到ThirdLibInvoker.cpp里面去Lib = NewObject<UThirdLibInvoker>();Lib->InvokeLib();}
void FMyThirdPlugin2Module::ShutdownModule()
{//刪掉這里面的代碼
}

(3)MyThirdPlugin2.Build.cs修改

添加CoreUObject

5,第三方庫的代碼修改?及其 編譯方法

(1)ExampleLibrary.cpp代碼修改

改一個你喜歡的彈窗吧~

EXAMPLELIBRARY_EXPORT void ExampleLibraryFunction()
{
#if defined _WIN32 || defined _WIN64MessageBox(NULL, TEXT("你成功調(diào)用了我(* ^ *)~"), TEXT("Third Party Plugin"), MB_OK);
#elseprintf("Loaded ExampleLibrary from Third Party Plugin sample");
#endif
}

(2) 編譯方式

1,VS新建一個工程叫MyThirdLibPluginLibrary,我放在了這里:UE4_PluginAndSlate\Plugins\MyThirdPlugin2\Source\ThirdParty\MyThirdPlugin2Library\ExampleLibrary\MyThirdLibPluginLibrary

2,工程中添加ExampleLibrary.cpp,?ExampleLibrary.h兩個文件

3,修改MyThirdLibPluginLibrary工程屬性(點擊工程,右鍵選擇屬性):

????找到這兩個文件的路徑,修改輸出目錄為這兩個文件的路徑,如下圖

然后點擊右上角配置管理器,改為release:

4,將生成的dll拷貝到編輯器尋找的路徑下面

我們可以看到ThirdLibInvoker.cpp代碼里面是通過這句話來加載第三方庫的,編輯器只會朝這個路徑下尋找ExampleLibrary.dll,因此需要將新生成的ExampleLibrary.dll拷貝過去?

LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/MyThirdPlugin2Library/Win64/ExampleLibrary.dll"));

?4,游戲模塊的代碼修改?

(1).cs代碼統(tǒng)一修改

?UE4_PluginAndSlate.Build.cs

UE4_PluginAndSlate.Target.cs

UE4_PluginAndSlateEditor.Target.cs

?(2)MyGameModeBase

MyGameModeBase.h

添加beginplay函數(shù)

class UE4_PLUGINANDSLATE_API AMyGameModeBase : public AGameModeBase
{GENERATED_BODY()
protected:virtual void BeginPlay() override;
};

MyGameModeBase.cpp

void AMyGameModeBase::BeginPlay()
{Super::BeginPlay();UThirdLibInvoker* Lib = NewObject<UThirdLibInvoker>();Lib->InvokeLib();
}

5,設(shè)置世界場景運行游戲

設(shè)置游戲模式,并且運行

?

運行結(jié)果:?

?

http://www.risenshineclean.com/news/37779.html

相關(guān)文章:

  • 樂清網(wǎng)站關(guān)鍵詞下載
  • 不用ftp做網(wǎng)站seo工作室
  • 建網(wǎng)站的公司不肯簽合同福州seo推廣優(yōu)化
  • 微網(wǎng)站制作軟件線上線下整合營銷方案
  • 推廣業(yè)務(wù)網(wǎng)站建設(shè)網(wǎng)站服務(wù)器速度對seo有什么影響
  • 青島網(wǎng)站模板建站做推廣的都是怎么推
  • 穹拓做網(wǎng)站站長工具seo查詢
  • 網(wǎng)站建設(shè)成本價瀏覽器看b站
  • 合肥知名網(wǎng)站制作新聞頭條最新消息今天
  • 桂林網(wǎng)站建設(shè)凡森網(wǎng)絡(luò)網(wǎng)絡(luò)推廣用什么軟件好
  • wordpress 主題 修改鄭州seo哪家好
  • 寧波網(wǎng)絡(luò)推廣制作seo是哪里
  • 沈陽網(wǎng)站seo排名優(yōu)化愛網(wǎng)站關(guān)鍵詞查詢工具
  • 網(wǎng)站模版建站免費引流人脈推廣軟件
  • 網(wǎng)站被降權(quán)的原因怎么知道網(wǎng)站有沒有被收錄
  • 做網(wǎng)站業(yè)務(wù)員怎么樣烘焙甜點培訓(xùn)學(xué)校
  • 電商視覺設(shè)計網(wǎng)站批量優(yōu)化網(wǎng)站軟件
  • 外國做營銷方案的網(wǎng)站360建站和凡科哪個好
  • 建設(shè)銀行北京東四支行網(wǎng)站愛站網(wǎng)關(guān)鍵詞排名
  • 網(wǎng)站建設(shè)下什么科目武漢seo搜索引擎優(yōu)化
  • 慈溪做無痛同濟 網(wǎng)站北京最新疫情情況
  • 寧夏網(wǎng)站設(shè)計聯(lián)系電話推廣公司屬于什么公司
  • 合肥做網(wǎng)站多少錢資源網(wǎng)
  • wordpress sozo西安關(guān)鍵詞seo公司
  • 做網(wǎng)站銷售的技巧關(guān)鍵詞排名優(yōu)化教程
  • 電子商務(wù)網(wǎng)站開發(fā)模塊流程圖網(wǎng)站建設(shè)優(yōu)化哪家公司好
  • 做技術(shù)分享網(wǎng)站有哪些手機軟文廣告300字
  • 建甌做網(wǎng)站的公司實時軍事熱點
  • 網(wǎng)站內(nèi)容設(shè)計要求網(wǎng)站seo的優(yōu)化怎么做
  • 如何創(chuàng)建自己的博客網(wǎng)站google store