UE5编译并以插件形式集成cserialport串口库2-插件编辑部分
#include "CSerialPort.h" #include "UObjectTest.h" #define LOCTEXT_NAMESPACE "FCSerialPortModule" void FCSerialPortModule::StartupModule() { // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module UE_LOG(LogTemp,Warning,TEXT("***********************************************")); UE_LOG(LogTemp,Warning,TEXT("***************** STARTUP ******************")); UE_LOG(LogTemp,Warning,TEXT("***********************************************")); } void FCSerialPortModule::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. UE_LOG(LogTemp,Warning,TEXT("***********************************************")); UE_LOG(LogTemp,Warning,TEXT("***************** ENDUP ******************")); UE_LOG(LogTemp,Warning,TEXT("***********************************************")); } #undef LOCTEXT_NAMESPACE IMPLEMENT_MODULE(FCSerialPortModule, CSerialPort)
实际上startup和shutdown对于本插件没有什么作用
// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Modules/ModuleManager.h" class FCSerialPortModule : public IModuleInterface { public: /** IModuleInterface implementation */ virtual void StartupModule() override; virtual void ShutdownModule() override; };
浙公网安备 33010602011771号