engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 所有成员列表
FAssetData结构体 参考

A struct to hold important information about an assets found by the Asset Registry This struct is transient and should never be serialized 更多...

#include <AssetData.h>

Public 成员函数

 FAssetData ()=default
 Default constructor
 
 FAssetData (const FString &InLongPackageName, const FString &InObjectPath, FName InAssetClass, FAssetDataTagMap InTags=FAssetDataTagMap(), TArray< int32 > InChunkIDs=TArray< int32 >(), uint32 InPackageFlags=0)
 Constructor with a long package name and a full object path which might not be part of the package this asset is in.
 
 FAssetData (const UObject *InAsset, bool bAllowBlueprintClass=false)
 Constructor taking a UObject. 更多...
 
 FAssetData (FName InPackageName, FName InPackagePath, FName InAssetName, FName InAssetClass, FAssetDataTagMap InTags=FAssetDataTagMap(), TArray< int32 > InChunkIDs=TArray< int32 >(), uint32 InPackageFlags=0)
 Constructor building the ObjectPath in the form of InPackageName.InAssetName. 更多...
 
UObject * FastGetAsset (bool bLoad=false) const
 Returns the asset UObject if it is loaded or loads the asset if it is unloaded then returns the result
 
UObject * GetAsset () const
 Returns the asset UObject if it is loaded or loads the asset if it is unloaded then returns the result
 
UClass * GetClass () const
 Returns the class UClass if it is loaded. 更多...
 
FString GetExportTextName () const
 Returns the name for the asset in the form: Class'ObjectPath'
 
void GetExportTextName (FString &OutExportTextName) const
 Populates OutExportTextName with the name for the asset in the form: Class'ObjectPath'
 
FString GetFullName () const
 Returns the full name for the asset in the form: Class ObjectPath
 
void GetFullName (FString &OutFullName) const
 Populates OutFullName with the full name for the asset in the form: Class ObjectPath
 
FPrimaryAssetId GetPrimaryAssetId () const
 Gets primary asset id of this data
 
template<typename ValueType >
bool GetTagValue (const FName InTagName, ValueType &OutTagValue) const
 Try and get the value associated with the given tag as a type converted value
 
template<typename ValueType >
ValueType GetTagValueRef (const FName InTagName) const
 Try and get the value associated with the given tag as a type converted value, or an empty value if it doesn't exist
 
bool HasAllPackageFlags (uint32 FlagsToCheck) const
 Used to check whether all of the passed flags are set in the cached asset package flags. 更多...
 
bool HasAnyPackageFlags (uint32 FlagsToCheck) const
 Used to check whether the any of the passed flags are set in the cached asset package flags. 更多...
 
bool IsAssetLoaded () const
 Returns true if the asset is loaded
 
bool IsRedirector () const
 Returns true if the this asset is a redirector.
 
bool IsUAsset () const
 Returns true if this is the primary asset in a package, true for maps and assets but false for secondary objects like class redirectors
 
bool IsValid () const
 Checks to see if this AssetData refers to an asset or is NULL
 
bool operator== (const FAssetData &Other) const
 FAssetDatas are equal if their object paths match
 
void PrintAssetData () const
 Prints the details of the asset to the log
 
void SerializeForCache (FArchive &Ar)
 Serialize as part of the registry cache. 更多...
 
FSoftObjectPath ToSoftObjectPath () const
 Convert to a SoftObjectPath for loading
 

静态 Public 成员函数

static const TCHAR * GetCollectionTagPrefix ()
 The prefix used for collection entries inside TagsAndValues
 
template<class T >
static T * GetFirstAsset (const TArray< FAssetData > &Assets)
 Convenience template for finding first asset of a class
 
static FAssetData GetFirstAssetDataOfClass (const TArray< FAssetData > &Assets, const UClass *DesiredClass)
 Get the first FAssetData of a particular class from an Array of FAssetData
 

Public 属性

FName AssetClass
 The name of the asset's class
 
FName AssetName
 The name of the asset without the package
 
TArray< int32 > ChunkIDs
 The IDs of the pakchunks this asset is located in for streaming install. 更多...
 
FName ObjectPath
 The object path for the asset in the form PackageName.AssetName. 更多...
 
uint32 PackageFlags = 0
 Asset package flags
 
FName PackageName
 The name of the package in which the asset is found, this is the full long package name such as /Game/Path/Package
 
FName PackagePath
 The path to the package in which the asset is found, this is /Game/Path with the Package stripped off
 
FAssetDataTagMapSharedView TagsAndValues
 The map of values for properties that were marked AssetRegistrySearchable or added by GetAssetRegistryTags
 

详细描述

A struct to hold important information about an assets found by the Asset Registry This struct is transient and should never be serialized

构造及析构函数说明

◆ FAssetData() [1/2]

FAssetData::FAssetData ( FName  InPackageName,
FName  InPackagePath,
FName  InAssetName,
FName  InAssetClass,
FAssetDataTagMap  InTags = FAssetDataTagMap(),
TArray< int32 >  InChunkIDs = TArray<int32>(),
uint32  InPackageFlags = 0 
)
inline

Constructor building the ObjectPath in the form of InPackageName.InAssetName.

does not work for object outer-ed to a different package.

◆ FAssetData() [2/2]

FAssetData::FAssetData ( const UObject *  InAsset,
bool  bAllowBlueprintClass = false 
)
inline

Constructor taking a UObject.

By default trying to create one for a blueprint class will create one for the UBlueprint instead, but this can be overridden

成员函数说明

◆ GetClass()

UClass * FAssetData::GetClass ( ) const
inline

Returns the class UClass if it is loaded.

It is not possible to load the class if it is unloaded since we only have the short name.

◆ HasAllPackageFlags()

bool FAssetData::HasAllPackageFlags ( uint32  FlagsToCheck) const
inline

Used to check whether all of the passed flags are set in the cached asset package flags.

参数
FlagsToCheckPackage flags to check for
返回
true if all of the passed in flags are set (including no flags passed in), false otherwise
参见
UPackage::HasAllPackagesFlags

◆ HasAnyPackageFlags()

bool FAssetData::HasAnyPackageFlags ( uint32  FlagsToCheck) const
inline

Used to check whether the any of the passed flags are set in the cached asset package flags.

参数
FlagsToCheckPackage flags to check for
返回
true if any of the passed in flag are set, false otherwise
参见
UPackage::HasAnyPackageFlags

◆ SerializeForCache()

void FAssetData::SerializeForCache ( FArchive &  Ar)
inline

Serialize as part of the registry cache.

This is not meant to be serialized as part of a package so it does not handle versions normally To version this data change FAssetRegistryVersion

类成员变量说明

◆ ChunkIDs

TArray<int32> FAssetData::ChunkIDs

The IDs of the pakchunks this asset is located in for streaming install.

Empty if not assigned to a chunk

◆ ObjectPath

FName FAssetData::ObjectPath

The object path for the asset in the form PackageName.AssetName.

Only top level objects in a package can have AssetData


该结构体的文档由以下文件生成: