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)
相关推荐
智者知已应修善业7 小时前
【查找字符最大下标以*符号分割以**结束】2024-12-24
c语言·c++·经验分享·笔记·算法
91刘仁德8 小时前
c++类和对象(下)
c语言·jvm·c++·经验分享·笔记·算法
diediedei8 小时前
模板编译期类型检查
开发语言·c++·算法
mmz12078 小时前
分治算法(c++)
c++·算法
一切尽在,你来8 小时前
C++多线程教程-1.2.1 C++11/14/17 并发特性迭代
开发语言·c++
80530单词突击赢9 小时前
C++入门指南:从零到精通
开发语言·c++
Tansmjs9 小时前
C++编译期数据结构
开发语言·c++·算法
diediedei9 小时前
C++类型推导(auto/decltype)
开发语言·c++·算法
兩尛9 小时前
c++的数组和Java数组的不同
java·开发语言·c++
lhxcc_fly9 小时前
手撕简易版的vector
c++·vector