From 7cdb77adf3334c5aee5d31608f78ea85e6bb994a Mon Sep 17 00:00:00 2001 From: simonyan <315082291@qq.com> Date: Fri, 31 May 2024 18:19:33 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B5=8B=E8=AF=95=E4=BB=93=E5=BA=93?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/RuntimeMeshLoader/Private/MeshLoader.cpp | 4 +++- .../Source/RuntimeMeshLoader/Public/MeshLoader.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Private/MeshLoader.cpp b/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Private/MeshLoader.cpp index a10a615..addd4e2 100644 --- a/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Private/MeshLoader.cpp +++ b/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Private/MeshLoader.cpp @@ -152,13 +152,15 @@ FString UMeshLoader::OpenFileDialog() return FilePath; } -bool UMeshLoader::CreateDirectoryAndFile(FString FilePath) { +FFolderPath UMeshLoader::CreateDirectoryAndFile(FString FilePath) { if (!FilePath.IsEmpty()) { IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile(); + FFolderPath ReturnFolderPath; // 首先检查源文件是否存在 if (!PlatformFile.FileExists(*FilePath)) { UE_LOG(LogTemp, Error, TEXT("Source file does not exist: %s"), *FilePath); + return false; // 如果源文件不存在,则返回失败 } diff --git a/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Public/MeshLoader.h b/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Public/MeshLoader.h index f36f5da..bbc0a20 100644 --- a/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Public/MeshLoader.h +++ b/Plugins/RuntimeMeshLoader/Source/RuntimeMeshLoader/Public/MeshLoader.h @@ -50,6 +50,17 @@ struct FNodeData TArray Meshes; }; +USTRUCT(BlueprintType) +struct FFolderPath +{ + GENERATED_BODY() + UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") + FString FolderPath; + + UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "FinalReturnData") + bool bSuccess; + +}; USTRUCT(BlueprintType) struct FFinalReturnData {