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)
相关推荐
fqbqrr9 小时前
2606C++,C++构的多态
开发语言·c++
小欣加油10 小时前
leetcode56 合并区间
c++·算法·leetcode·职场和发展
Yolo_TvT11 小时前
C++:析构函数
c++
Hello:CodeWorld12 小时前
C 风格变参 vs C++ 变参模板:核心区别与选型指南
c语言·c++·算法
搬砖魁首15 小时前
基础能力系列 - 多线程2 - 条件变量
c++·rust·条件变量·原子类型·线程同步互斥
chase_my_dream15 小时前
C++ + SLAM 高频面试问题整理
开发语言·c++·面试
牛油果子哥q15 小时前
【C++ STL string 】C++ STL string 终极精讲:底层原理、内存机制、全套API、深浅拷贝、易错坑点与工程实战规范
数据库·c++
凡人叶枫17 小时前
Effective C++ 条款04:确定对象被使用前已先被初始化
java·linux·开发语言·c++·嵌入式开发
不想写代码的星星17 小时前
std::move 根本不移动,就像老婆饼里没有老婆
c++
redaijufeng17 小时前
C++雾中风景7:闭包
c++·算法·风景