UAssetManager::GetPrimaryAssetDataList
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Gets the list of all FAssetData for every primary asset registered under a given type.
Caveats & Gotchas
- • Returns false if the type is unknown or no assets of that type were found — AssetDataList is left unmodified in that case.
- • Results reflect only assets scanned so far; assets added at runtime after the initial scan won't appear unless rescanned.
Signature
virtual bool GetPrimaryAssetDataList(FPrimaryAssetType PrimaryAssetType, TArray<FAssetData>& AssetDataList) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrimaryAssetType | FPrimaryAssetType | Primary asset type to enumerate. | — |
| AssetDataList | TArray<FAssetData>& | Out array appended with the FAssetData for every registered asset of that type. | — |
Return Type
bool Example
Enumerate all items C++
TArray<FAssetData> ItemAssets;
if (UAssetManager::Get().GetPrimaryAssetDataList(FPrimaryAssetType(TEXT("Item")), ItemAssets))
{
UE_LOG(LogTemp, Log, TEXT("Found %d items"), ItemAssets.Num());
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?