7#include "Engine/World.h"
11 TArray<FAssetData> AssetDatas =
GetAssetData(onlyAgrarsenseMapFolder);
13 TArray<FString> mapNames = TArray<FString>();
14 for (int32 i = 0; i < AssetDatas.Num(); ++i)
16 FAssetData& mapAssetData = AssetDatas[i];
17 auto name = mapAssetData.AssetName.ToString();
24 UE_LOG(LogTemp, Warning, TEXT(
"Found %d maps. Map names:"), AssetDatas.Num());
25 for (
int i = 0; i < mapNames.Num(); i++)
27 UE_LOG(LogTemp, Warning, TEXT(
"%s"), *mapNames[i]);
37 TArray<FAssetData> AssetDatas =
GetAssetData(onlyAgrarsenseMapFolder);
39 TArray<FString> mapPaths = TArray<FString>();
40 for (int32 i = 0; i < AssetDatas.Num(); ++i)
42 FAssetData& mapAssetData = AssetDatas[i];
43 auto name = mapAssetData.PackagePath.ToString();
50 UE_LOG(LogTemp, Warning, TEXT(
"Found %d maps. Map paths:"), AssetDatas.Num());
51 for (
int i = 0; i < mapPaths.Num(); i++)
53 UE_LOG(LogTemp, Warning, TEXT(
"%s"), *mapPaths[i]);
63 TArray<FAssetData> AssetDatas =
GetAssetData(onlyAgrarsenseMapFolder);
70 FString path =
"/Game/";
71 if (onlyAgrarsenseMapFolder)
73 path =
"/Game/Agrarsense/Maps";
76 auto ObjectLibrary = UObjectLibrary::CreateLibrary(UWorld::StaticClass(),
false,
true);
77 ObjectLibrary->LoadAssetDataFromPath(path);
78 TArray<FAssetData> AssetDatas;
79 ObjectLibrary->GetAssetDataList(AssetDatas);
static TArray< FAssetData > GetAssetData(bool onlyAgrarsenseMapFolder)
static TArray< FAssetData > GetAllMapAssetDatas(bool onlyAgrarsenseMapFolder=true)
static TArray< FString > GetAllMapNames(bool onlyAgrarsenseMapFolder=true, bool logResults=false)
static TArray< FString > GetAllMapPaths(bool onlyAgrarsenseMapFolder=true, bool logResults=false)