ue 自己制作插件 c++

目录

[方法 1(推荐):UE 编辑器里创建](#方法 1(推荐):UE 编辑器里创建)

[webclient 类代码:](#webclient 类代码:)


方法 1(推荐):UE 编辑器里创建

  1. 打开 UE5.6

  2. 编辑(Edit)插件(Plugins)

  3. 点击 New Plugin

  4. 选择:

    • Blank

    • 类型:C++

  5. 填写:

    • Name:DemoPlugin

    • 勾选:Enabled By Default

  6. 创建后 重启编辑器

webclient 类代码:

webclient.h

cpp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Modules/ModuleManager.h"

class FwebclientModule : public IModuleInterface
{
public:

	/** IModuleInterface implementation */
	virtual void StartupModule() override;
	virtual void ShutdownModule() override;
	void HelloWorld();
};

webclient\Private\webclient.cpp

cpp 复制代码
// Copyright Epic Games, Inc. All Rights Reserved.

#include "webclient.h"

#define LOCTEXT_NAMESPACE "FwebclientModule"

#include "Modules/ModuleManager.h"
#include "Logging/LogMacros.h"

DEFINE_LOG_CATEGORY_STATIC(LogWebClient, Log, All);


UFUNCTION(BlueprintCallable, Category = "WebClient")
static void HelloWorld()
{
	UE_LOG(LogTemp, Error, TEXT("Hello World (Play Mode)"));
}

void FwebclientModule::StartupModule()
{
	UE_LOG(LogWebClient, Log, TEXT("webclient module started"));
	// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
	HelloWorld();
}

void FwebclientModule::HelloWorld()
{
	UE_LOG(LogWebClient, Error, TEXT("Hello World from webclient plugin 111"));
}

void FwebclientModule::ShutdownModule()
{
	// This function may be called during shutdown to clean up your module.  For modules that support dynamic reloading,
	// we call this function before unloading the module.
}

#undef LOCTEXT_NAMESPACE
	
IMPLEMENT_MODULE(FwebclientModule, webclient)
相关推荐
肆忆_1 天前
# 用 5 个问题学懂 C++ 虚函数(入门级)
c++
不想写代码的星星1 天前
虚函数表:C++ 多态背后的那个男人
c++
端平入洛3 天前
delete又未完全delete
c++
端平入洛4 天前
auto有时不auto
c++
哇哈哈20215 天前
信号量和信号
linux·c++
多恩Stone5 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
蜡笔小马5 天前
21.Boost.Geometry disjoint、distance、envelope、equals、expand和for_each算法接口详解
c++·算法·boost
超级大福宝5 天前
N皇后问题:经典回溯算法的一些分析
数据结构·c++·算法·leetcode
weiabc5 天前
printf(“%lf“, ys) 和 cout << ys 输出的浮点数格式存在细微差异
数据结构·c++·算法
问好眼5 天前
《算法竞赛进阶指南》0x01 位运算-3.64位整数乘法
c++·算法·位运算·信息学奥赛