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)
相关推荐
爱写Bug的浮游37 分钟前
C++移动构造真的比拷贝快吗
c++·性能优化
Aaa西红柿鸡蛋1 小时前
网络协议分析实验:基于 UDP 广播模型的 C/S 通信设计与实现
c++
青少儿编程课堂1 小时前
蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级:扫描线与线段树求矩形面积并解析
c++·python·算法·bfs·信息学竞赛
eggwyw20 小时前
C++ union 的一种妙用法
开发语言·c++
ShineWinsu1 天前
对于Qt:QHBoxLayout常见属性以及方法的解析
c++·qt·面试·gui·客户端·布局管理器·水平布局器
小七在进步1 天前
string的实现(1)
c++·笔记·visual studio
敲上瘾1 天前
Qt核心机制:信号与槽详解
开发语言·c++·qt·ui·qt6.3
牢姐与蒯1 天前
cpp算法之哈希
c++·算法·哈希算法
lcj25111 天前
[C++] C++11
开发语言·c++·笔记
小小bugbug1 天前
带工作窃取的线程池
c++·线程池