成人免费黄色网_曰本女同videos_男女在线观看视频_在线亚洲黄色_欧美欧美欧美欧美_bestialityvideo另类最新

  • UE4實(shí)現(xiàn)簡(jiǎn)單的插件開(kāi)發(fā)VS2015

    2017/8/8??????點(diǎn)擊:

    1. 從Editor中生成一個(gè)空的C++插件模板

    2. 關(guān)掉vs,右鍵生成一下工程文件,把Plugins掃進(jìn)去

    打開(kāi)解決方案開(kāi)始編寫插件,插件加進(jìn)來(lái)了 

    3. 編寫插件
    首先把插件的配置文TestPlugin.uplugin件改一下(被這個(gè)坑了兩天) 
    這個(gè)LoadingPhase的值默認(rèn)為Default,必須修改為PreDefault,不然重啟Editor會(huì)報(bào)關(guān)聯(lián)不上插件源碼的錯(cuò)誤,切記! 


    修改編譯模塊配置TestPlugin.Build.cs文件,c#文件 


    詳細(xì)代碼,有注釋 !
    using UnrealBuildTool;
    using System.IO; //路徑獲取需要用到IO
    public class TestPlugin : ModuleRules
    {
        private string ModulePath //當(dāng)前TestPlugin.Build.cs文件所在的路徑
        {
            get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
        }
        private string ThirdPartyPath //這個(gè)插件引用的第三方庫(kù)的目錄
        {
            get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
        }
        private string MyTestLibPath //第三方庫(kù)MyTestLib的目錄
        {
            get { return Path.GetFullPath(Path.Combine(ThirdPartyPath, "MyTestLib")); }
        }
        public TestPlugin(TargetInfo Target)
        {
            PublicIncludePaths.AddRange( //公有文件搜索路徑
                new string[] {
                    "TestPlugin/Public"
                    // ... add public include paths required here ...
                }
                );
            PrivateIncludePaths.AddRange(
                new string[] {
                    "TestPlugin/Private" //私有文件搜索路徑
                    // ... 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 ...
                }
                );
            LoadThirdPartyLib(Target); //加載第三方庫(kù)
        }
        public bool LoadThirdPartyLib(TargetInfo Target)
        {
            bool isLibrarySupported = false;
            if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))//平臺(tái)判斷
            {
                isLibrarySupported = true;
                System.Console.WriteLine("----- isLibrarySupported true");
                string PlatformSubPath = (Target.Platform == UnrealTargetPlatform.Win64) ? "Win64" : "Win32";
                string LibrariesPath = Path.Combine(MyTestLibPath, "Lib");
                PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, PlatformSubPath, "TestLib.lib"));//加載第三方靜態(tài)庫(kù).lib
            }
            if (isLibrarySupported) //成功加載庫(kù)的情況下,包含第三方庫(kù)的頭文件
            {
                // Include path
                System.Console.WriteLine("----- PublicIncludePaths.Add true"); 
                PublicIncludePaths.Add(Path.Combine(MyTestLibPath, "Include"));
            }
            return isLibrarySupported;
        }
    }

    我們寫個(gè)自定義的char – TestChar,繼承自Character 
    先看下文件結(jié)構(gòu),需要藍(lán)圖可見(jiàn)的必須丟到Public下 


    先修改預(yù)編譯頭文件TestPluginPrivatePCH.h,必須包含CoreUObject,不然編譯不過(guò),切記!
    #include "TestPlugin.h"
    // UObject core
    #include "CoreUObject.h" //默認(rèn)是不含這個(gè)的
    // Actor based classes
    #include "GameFramework/Character.h" //包插件中所有用的的引擎類都丟到這里來(lái)


    頭文件,正常編寫自定義的類一樣
    #pragma once
    #include "GameFramework/Character.h"
    #include "TestChar.generated.h"
    UCLASS()
    class ATestChar : public ACharacter
    {
        GENERATED_BODY()
    public:
        // Sets default values for this character\'s properties
        ATestChar();
        UPROPERTY(EditAnywhere, Category = "Test Char")
            int32           mAge;
        UPROPERTY(EditAnywhere, Category = "Test Char")
            FString         mName;
    };

    cpp文件,包含的是預(yù)編譯文件和類的頭文件
    #include "TestPluginPrivatePCH.h"
    #include "TestChar.h"
    #include "TestLib.h" //引入的第三方庫(kù)的頭文件
    ATestChar::ATestChar() : Super()
    {
        mAge = myPrint("hello world", 123); //第三方庫(kù)中的方法
        mName = "yangx";
    }

    第三方庫(kù)打成了一個(gè)靜態(tài)庫(kù)TestLib.lib
    TestLib.h
    #ifndef __TEST_LIB_H__
    #define __TEST_LIB_H__
    #include
    #include
    int myPrint(std::string _name, int _age);
    #endif

    TestLib.cpp
    #include "TestLib.h"
    int myPrint(std::string _name, int _age)
    {
        return _age + 1000;
    }

    4. 編譯運(yùn)行,在Editor中create一個(gè)Blueprint繼承自這個(gè)TestChar類


    5. 拖到場(chǎng)景運(yùn)行游戲

    6.WONGLOVE數(shù)據(jù)手套的UE4插件類似于上述方法, 如果您是WONGLOVE用戶,可以聯(lián)系我們索取該插件程序。


    主站蜘蛛池模板: 国产女教师一爽a片 | 色综合天天综合网国产成人网 | 天堂网中文在线资源 | 伊波拉病毒在线观看 | 亚洲爆乳无码专区 | 2024国产在线| 亚洲成人免费在线观看 | 极品xxxx欧美一区二区 | 喜欢你我也是第四季免费观看 | 天美传媒一区二区 | 国产性夜夜春夜夜爽有声小说 | 在线视频精品少白免费观看 | 亚洲天堂精品视频 | a级毛片免费在线 | 久久久久人妻一区二区三区VR | 黄色大片一级 | 少妇被粗大的猛烈进出动视频 | 影音先锋一区 | 99狠狠| 亚洲乱码中文 | 久久人人爽人人爽人人av麻豆 | 老子午夜精品888无码不卡 | 一边吃奶一边啪受不了 | 亚洲欧美激情视频在线观看一区二区三区 | 亚洲欧美日韩视频一区 | 成年人在线免费观看视频 | 裸体性做爰免费视频网站 | 商场女厕偷拍一区二区三区视频 | 无码人妻精品一区二区三区久久 | 蜜桃av噜噜一区二区三区小说 | 精品欧美一区二区三区精品久久 | 最近中文字幕免费观看 | 福利小视频在线观看 | 亚洲高清免费视频 | 欧美午夜少妇 | 野花日本大全免费观看 | 欧美视频偷拍 | 成人试看30分钟免费视频软件 | 日本高清视频色WWW色 | WWW亚洲色大成网络 久久久久国色AⅤ免费看 | 日日摸日日干 |