UAssetManager::ShouldScanPrimaryAssetType
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Returns true if the specified Primary Asset type info should be scanned during directory scans. Can be overridden by a game-specific Asset Manager subclass to conditionally skip or modify types at runtime.
Caveats & Gotchas
- • TypeInfo is passed by reference and can be modified in the override before returning, which lets you adjust scan paths per-platform or per-build-configuration rather than just accepting or rejecting the entry.
- • Called once per configured Primary Asset type during ScanPrimaryAssetTypesFromConfig, not per-asset, so it can't be used to filter individual assets within a type.
Signature
virtual bool ShouldScanPrimaryAssetType(FPrimaryAssetTypeInfo& TypeInfo) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TypeInfo | FPrimaryAssetTypeInfo& | Type info entry from Asset Manager settings, possibly modified before scanning. | — |
Return Type
bool Example
Skip a type in non-editor builds C++
bool UMyAssetManager::ShouldScanPrimaryAssetType(FPrimaryAssetTypeInfo& TypeInfo) const
{
if (TypeInfo.PrimaryAssetType == FPrimaryAssetType("EditorTool") && !GIsEditor)
{
return false;
}
return Super::ShouldScanPrimaryAssetType(TypeInfo);
} Tags
Version History
Introduced in: 4.22
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?