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:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class CoreTwo : ModuleRules
{
	public CoreTwo(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine"});
	}
}

主模块.Build.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class MyCTest : ModuleRules
{
	public MyCTest(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Sockets", "Networking", "DesktopPlatform", "Json", "JsonUtilities", "Testor" });
	}
}

主模块.Target.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class MyCTestTarget : TargetRules
{
	public MyCTestTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		ExtraModuleNames.AddRange(new string[] { "MyCTest", "CoreTwo" });
	}
}

主模块Editor.Target.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class MyCTestEditorTarget : TargetRules
{
	public MyCTestEditorTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		ExtraModuleNames.AddRange(new string[] { "MyCTest", "CoreTwo" });
	}
}

主模块.uproject:

{
	"FileVersion": 3,
	"EngineAssociation": "4.27",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "MyCTest",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"Engine",
				"UMGEditor"
			]
		},
		{
			"Name": "CoreTwo",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	],
	"Plugins": [
		{
			"Name": "Testor",
			"Enabled": true
		}
	]
}

插件Testor.uplugin:

{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "Testor",
	"Description": "wangjunli created",
	"Category": "Other",
	"CreatedBy": "WJL",
	"CreatedByURL": "https://blog.csdn.net/qqQQqsadfj?type=blog",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"CanContainContent": true,
	"IsBetaVersion": false,
	"IsExperimentalVersion": false,
	"Installed": false,
	"Modules": [
		{
			"Name": "Testor",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	]
}

总结:

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值