UPrimaryDataAsset

A DataAsset that implements GetPrimaryAssetId and has asset bundle support, which allows it to be manually loaded/unloaded from the AssetManager.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/DataAsset.h

Include

#include "Engine/DataAsset.h"

Syntax

class UPrimaryDataAsset : public UDataAsset

Remarks

A DataAsset that implements GetPrimaryAssetId and has asset bundle support, which allows it to be manually loaded/unloaded from the AssetManager. Instances of native subclasses can be created directly as Data Assets and will use the name of the native class as the PrimaryAssetType. Or, blueprint subclasses can be created with a PrimaryAssetType equal to the name of the first native class going up the hierarchy, or the highest level blueprint class. IE, if you have UPrimaryDataAsset -> UParentNativeClass -> UChildNativeClass -> DataOnlyBlueprintClass the type will be ChildNativeClass. Whereas if you have UPrimaryDataAsset -> ParentBlueprintClass -> DataOnlyBlueprintClass the type will be ParentBlueprintClass. To change this behavior, override GetPrimaryAssetId in your native class or copy those functions into a different native base class.

Variables

Name Description

Protected variable

FAssetBundleDat...

 

AssetBundleData

Asset Bundle data computed at save time. In cooked builds this is accessible from AssetRegistry

Functions

Name Description

Public function Virtual

void

 

UpdateAssetBundleData()

This scans the class for AssetBundles metadata on asset properties and initializes the AssetBundleData with InitializeAssetBundlesFromMetadata

Overridden from UObject

Name Description

Public function Virtual Const

FPrimaryAsse...

 

GetPrimaryAssetId()

Returns an Type:Name pair representing the PrimaryAssetId for this object.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

PreSave

(
    FObjectPreSaveContext SaveContext
)

Presave function.

Deprecated Functions

Name Description

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Use version that takes FObjectPreSaveContext instead.