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 {