RealDocs

UAssetManager::AcquireResourcesForPrimaryAssetList

function Engine Since unknown
#include "Engine/AssetManager.h"
Access: public Specifiers: virtual

Description

Acquires the platform chunks needed for every bundle of the given primary assets, then invokes CompleteDelegate. Unlike AcquireResourcesForAssetList, this expands each primary asset to all of its bundles automatically.

Caveats & Gotchas

  • Downloads all bundles of each primary asset, which can be considerably more data than you actually intend to load if the asset has bundles you don't need yet.
  • As with the asset-list overload, any single chunk failure marks the whole request as failed even if the rest installed successfully.

Signature

virtual void AcquireResourcesForPrimaryAssetList(const TArray<FPrimaryAssetId>& PrimaryAssetList, FAssetManagerAcquireResourceDelegate CompleteDelegate, EChunkPriority::Type Priority = EChunkPriority::Immediate);

Parameters

Name Type Description Default
PrimaryAssetList const TArray<FPrimaryAssetId>& Primary assets to acquire chunk resources for.
CompleteDelegate FAssetManagerAcquireResourceDelegate Called with a single success flag once acquisition finishes or fails.
Priority EChunkPriority::Type Priority to use when acquiring chunks through the platform chunk layer. EChunkPriority::Immediate

Return Type

void

Example

Acquire chunks for a set of primary assets C++
UAssetManager& Manager = UAssetManager::Get();
TArray<FPrimaryAssetId> AssetIds = { FPrimaryAssetId(TEXT("Map"), TEXT("DLC1_Level")) };
Manager.AcquireResourcesForPrimaryAssetList(AssetIds, FAssetManagerAcquireResourceDelegate::CreateLambda(
	[](bool bSuccess)
	{
		UE_LOG(LogTemp, Log, TEXT("Acquire finished: %d"), bSuccess);
	}));

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.