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)
相关推荐
丰色木夕21 分钟前
Ubuntu22.04下源码编译安装USD-Brep
c++·ubuntu·nvidia·usd-brep
衍玊3 小时前
多路转接原理与应用
c++
himobrinehacken5 小时前
位运算揭秘:左右移与符号位陷阱
c语言·c++·算法·安全
Android小码家7 小时前
Vehicle 实战 自定义属性+测试demo
java·c++·framework·vhal·vehicle
hetao17338377 小时前
2026-10-19 hetao1733837 的刷题记录
c++·算法
夏虫不可与之言冰7 小时前
第三课 点亮 LED 与定时器非阻塞闪烁
c语言·c++·vscode·单片机·嵌入式硬件·物联网
辛苦才能8 小时前
C++ 哈希表深度解析:删除为什么必须打标记,负载因子为什么卡 0.7
开发语言·数据结构·c++·算法
miller-tsunami8 小时前
STL简介&string相关知识点
开发语言·c++·string
坤坤子吖8 小时前
Linux 线程同步与互斥——互斥锁
linux·服务器·c++·笔记·学习
TDTC_XQ8 小时前
Linux网络编程accept的讲解
linux·服务器·c++