• U++ 插件学习笔记


    Type:

    Editor:插件只能在编辑器有效

    Runtime:代表打包出来也会有插件功能

    Developer:开发者模式可以使用插件功能

    Program:独立的小程序

    ServerOnly:服务端可以使用插件功能

    ClientOnly:客户端可以使用插件功能


    LoadingPhase:

    1、PostConfigInit:引擎初始化之前配置文件初始化之后进行加载

    2、PreEarlyLoadingScreen:在coreUObject之前进行加载

    3、PreLoadingScreen:在引擎完全被初始化之前进行加载

    4、PreDefault:默认模块之前进行加载

    5、Default:默认模块进行加载

    6、PostDefault:默认模块之后进行加载

    7、PostEngineInit:引擎初始化之后进行加载


    插件依赖不能依赖Private的内容 


    如何在C++中使用插件:

    Enable设置为true代表已经启动


     

    .Build:做连接操作

    .Target:做编译操作

    一个插件至少含有一个模块


    模块CoreTwo.Build.cs:

    1. // Copyright Epic Games, Inc. All Rights Reserved.
    2. using UnrealBuildTool;
    3. public class CoreTwo : ModuleRules
    4. {
    5. public CoreTwo(ReadOnlyTargetRules Target) : base(Target)
    6. {
    7. PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    8. PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine"});
    9. }
    10. }

    主模块.Build.cs:

    1. // Copyright Epic Games, Inc. All Rights Reserved.
    2. using UnrealBuildTool;
    3. public class MyCTest : ModuleRules
    4. {
    5. public MyCTest(ReadOnlyTargetRules Target) : base(Target)
    6. {
    7. PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    8. PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Sockets", "Networking", "DesktopPlatform", "Json", "JsonUtilities", "Testor" });
    9. }
    10. }

    主模块.Target.cs:

    1. // Copyright Epic Games, Inc. All Rights Reserved.
    2. using UnrealBuildTool;
    3. using System.Collections.Generic;
    4. public class MyCTestTarget : TargetRules
    5. {
    6. public MyCTestTarget(TargetInfo Target) : base(Target)
    7. {
    8. Type = TargetType.Game;
    9. DefaultBuildSettings = BuildSettingsVersion.V2;
    10. ExtraModuleNames.AddRange(new string[] { "MyCTest", "CoreTwo" });
    11. }
    12. }

    主模块Editor.Target.cs:

    1. // Copyright Epic Games, Inc. All Rights Reserved.
    2. using UnrealBuildTool;
    3. using System.Collections.Generic;
    4. public class MyCTestEditorTarget : TargetRules
    5. {
    6. public MyCTestEditorTarget(TargetInfo Target) : base(Target)
    7. {
    8. Type = TargetType.Editor;
    9. DefaultBuildSettings = BuildSettingsVersion.V2;
    10. ExtraModuleNames.AddRange(new string[] { "MyCTest", "CoreTwo" });
    11. }
    12. }

    主模块.uproject:

    1. {
    2. "FileVersion": 3,
    3. "EngineAssociation": "4.27",
    4. "Category": "",
    5. "Description": "",
    6. "Modules": [
    7. {
    8. "Name": "MyCTest",
    9. "Type": "Runtime",
    10. "LoadingPhase": "Default",
    11. "AdditionalDependencies": [
    12. "Engine",
    13. "UMGEditor"
    14. ]
    15. },
    16. {
    17. "Name": "CoreTwo",
    18. "Type": "Runtime",
    19. "LoadingPhase": "Default"
    20. }
    21. ],
    22. "Plugins": [
    23. {
    24. "Name": "Testor",
    25. "Enabled": true
    26. }
    27. ]
    28. }

    插件Testor.uplugin:

    1. {
    2. "FileVersion": 3,
    3. "Version": 1,
    4. "VersionName": "1.0",
    5. "FriendlyName": "Testor",
    6. "Description": "wangjunli created",
    7. "Category": "Other",
    8. "CreatedBy": "WJL",
    9. "CreatedByURL": "https://blog.csdn.net/qqQQqsadfj?type=blog",
    10. "DocsURL": "",
    11. "MarketplaceURL": "",
    12. "SupportURL": "",
    13. "CanContainContent": true,
    14. "IsBetaVersion": false,
    15. "IsExperimentalVersion": false,
    16. "Installed": false,
    17. "Modules": [
    18. {
    19. "Name": "Testor",
    20. "Type": "Runtime",
    21. "LoadingPhase": "Default"
    22. }
    23. ]
    24. }

    总结:

    在Build.cs里面包含插件,在Target和Editor.Target内包含模块,在.uproject内包含模块和插件,并使插件设置为使用

  • 相关阅读:
    私藏干货分享:关于企业架构中如何进行平台化
    c# HashSet vs SortedSet
    Redis对象的数据结构及其原理汇总
    ValueError: invalid literal for int() with base 10: ‘‘
    CSDN 技能树使用体验与产品分析(1)
    概要了解postman、jmeter 、loadRunner
    C语言源代码系列-管理系统之文件加密任务书
    基于VUE + Echarts 实现可视化数据大屏文化大数据
    一文彻底解析数据库设计思路
    Dubbo+Zookeeper
  • 原文地址:https://blog.csdn.net/qqQQqsadfj/article/details/127988645