engine
 
载入中...
搜索中...
未找到
类 | Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | Protected 成员函数 | Protected 属性 | 所有成员列表
UAssetManager类 参考

A singleton UObject that is responsible for loading and unloading PrimaryAssets, and maintaining game-specific asset references Games should override this class and change the class reference 更多...

#include <AssetManager.h>

+ 类 UAssetManager 继承关系图:

类

struct  FPendingChunkInstall
 Defines a set of chunk installs that are waiting 更多...
 

Public 成员函数

virtual void AcquireResourcesForAssetList (const TArray< FSoftObjectPath > &AssetList, FAssetManagerAcquireResourceDelegateEx CompleteDelegate, EChunkPriority::Type Priority=EChunkPriority::Immediate)
 Acquires a set of chunks using the platform chunk layer, then calls the passed in callback 更多...
 
virtual void AcquireResourcesForPrimaryAssetList (const TArray< FPrimaryAssetId > &PrimaryAssetList, FAssetManagerAcquireResourceDelegate CompleteDelegate, EChunkPriority::Type Priority=EChunkPriority::Immediate)
 Acquires a set of chunks using the platform chunk layer, then calls the passed in callback. 更多...
 
virtual bool AddDynamicAsset (const FPrimaryAssetId &PrimaryAssetId, const FSoftObjectPath &AssetPath, const FAssetBundleData &BundleData)
 Adds or updates a Dynamic asset, which is a runtime-specified asset that has no on disk representation, so has no FAssetData. 更多...
 
virtual void CallOrRegister_OnCompletedInitialScan (FSimpleMulticastDelegate::FDelegate Delegate)
 Register a delegate to call when all types are scanned at startup, if this has already happened call immediately
 
virtual TSharedPtr< FStreamableHandle > ChangeBundleStateForMatchingPrimaryAssets (const TArray< FName > &NewBundles, const TArray< FName > &OldBundles, FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Changes the bundle state of all loaded primary assets. 更多...
 
virtual TSharedPtr< FStreamableHandle > ChangeBundleStateForPrimaryAssets (const TArray< FPrimaryAssetId > &AssetsToChange, const TArray< FName > &AddBundles, const TArray< FName > &RemoveBundles, bool bRemoveAllBundles=false, FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Changes the bundle state of a set of loaded primary assets. 更多...
 
virtual FPrimaryAssetId DeterminePrimaryAssetIdForObject (const UObject *Object)
 If bShouldManagerDetermineTypeAndName is true in settings, this function is used to determine the primary asset id for any object that does not have it's own implementation. 更多...
 
virtual FPrimaryAssetId ExtractPrimaryAssetIdFromData (const FAssetData &AssetData, FPrimaryAssetType SuggestedType=NAME_None) const
 Parses AssetData to extract the primary type/name from it. 更多...
 
virtual void ExtractSoftObjectPaths (const UStruct *Struct, const void *StructValue, TArray< FSoftObjectPath > &FoundAssetReferences, const TArray< FName > &PropertiesToSkip=TArray< FName >()) const
 Extracts all FSoftObjectPaths from a Class/Struct
 
virtual bool FindMissingChunkList (const TArray< FSoftObjectPath > &AssetList, TArray< int32 > &OutMissingChunkList, TArray< int32 > &OutErrorChunkList) const
 Returns the list of Chunks that are not currently mounted, and are required to load the referenced assets. 更多...
 
virtual void FinishInitialLoading ()
 Finishes initial loading, gets called from end of Engine::Init()
 
virtual bool GetAssetBundleEntries (const FPrimaryAssetId &BundleScope, TArray< FAssetBundleEntry > &OutEntries) const
 Appends all AssetBundleInfos inside a given scope
 
virtual FAssetBundleEntry GetAssetBundleEntry (const FPrimaryAssetId &BundleScope, FName BundleName) const
 Returns a single AssetBundleInfo, matching Scope and Name
 
virtual bool GetAssetDataForPath (const FSoftObjectPath &ObjectPath, FAssetData &AssetData) const
 Gets the FAssetData at a specific path, handles redirectors and blueprint classes correctly. 更多...
 
virtual FSoftObjectPath GetAssetPathForData (const FAssetData &AssetData) const
 Turns an FAssetData into FSoftObjectPath, handles adding _C as necessary
 
class IAssetRegistry & GetAssetRegistry () const
 Accessor for asset registry
 
virtual void GetCachedPrimaryAssetEncryptionKeyGuid (FPrimaryAssetId InPrimaryAssetId, FGuid &OutGuid)
 Get the encryption key guid attached to this primary asset. 更多...
 
virtual bool GetManagedPackageList (FPrimaryAssetId PrimaryAssetId, TArray< FName > &AssetPackageList) const
 Returns list of asset packages managed by primary asset
 
virtual bool GetPackageManagers (FName PackageName, bool bRecurseToParents, TSet< FPrimaryAssetId > &ManagerSet) const
 Returns list of PrimaryAssetIds that manage a package. 更多...
 
virtual void GetPreviousPrimaryAssetIds (const FPrimaryAssetId &NewId, TArray< FPrimaryAssetId > &OutOldIds) const
 Reads redirector list and gets a list of the redirected previous names for a Primary Asset Id
 
void GetPrimaryAssetBundleStateMap (TMap< FPrimaryAssetId, TArray< FName > > &BundleStateMap, bool bForceCurrent=false) const
 Fills in a TMap with the pending/active loading state of every asset
 
virtual bool GetPrimaryAssetData (const FPrimaryAssetId &PrimaryAssetId, FAssetData &AssetData) const
 Gets the FAssetData for a primary asset with the specified type/name, will only work for once that have been scanned for already. 更多...
 
virtual bool GetPrimaryAssetDataList (FPrimaryAssetType PrimaryAssetType, TArray< FAssetData > &AssetDataList) const
 Gets list of all FAssetData for a primary asset type, returns true if any were found
 
TSharedPtr< FStreamableHandle > GetPrimaryAssetHandle (const FPrimaryAssetId &PrimaryAssetId, bool bForceCurrent=false, TArray< FName > *Bundles=nullptr) const
 Returns the loading handle associated with the primary asset, it can then be checked for progress or waited on 更多...
 
virtual FPrimaryAssetId GetPrimaryAssetIdForData (const FAssetData &AssetData) const
 Returns the primary asset Id for the given FAssetData, only works if in directory
 
virtual FPrimaryAssetId GetPrimaryAssetIdForObject (UObject *Object) const
 Sees if the passed in object is a registered primary asset, if so return it. 更多...
 
virtual FPrimaryAssetId GetPrimaryAssetIdForPackage (FName PackagePath) const
 Sees if the package has a primary asset, useful if only the package name is available
 
virtual FPrimaryAssetId GetPrimaryAssetIdForPath (const FSoftObjectPath &ObjectPath) const
 Sees if the passed in object path is a registered primary asset, if so return it. 更多...
 
virtual bool GetPrimaryAssetIdList (FPrimaryAssetType PrimaryAssetType, TArray< FPrimaryAssetId > &PrimaryAssetIdList, EAssetManagerFilter Filter=EAssetManagerFilter::Default) const
 Gets list of all FPrimaryAssetId for a primary asset type, returns true if any were found
 
bool GetPrimaryAssetLoadSet (TSet< FSoftObjectPath > &OutAssetLoadSet, const FPrimaryAssetId &PrimaryAssetId, const TArray< FName > &LoadBundles, bool bLoadRecursive) const
 Fills in a set of object paths with the assets that need to be loaded, for a given Primary Asset and bundle list 更多...
 
virtual UObject * GetPrimaryAssetObject (const FPrimaryAssetId &PrimaryAssetId) const
 Gets the in-memory UObject for a primary asset id, returning nullptr if it's not in memory. 更多...
 
template<class AssetType >
FORCEINLINE AssetType * GetPrimaryAssetObject (const FPrimaryAssetId &PrimaryAssetId) const
 Templated versions of above
 
virtual bool GetPrimaryAssetObjectList (FPrimaryAssetType PrimaryAssetType, TArray< UObject * > &ObjectList) const
 Gets list of all loaded objects for a primary asset type, returns true if any were found. 更多...
 
virtual FSoftObjectPath GetPrimaryAssetPath (const FPrimaryAssetId &PrimaryAssetId) const
 Gets the FSoftObjectPath for a primary asset type and name, returns invalid if not found
 
virtual bool GetPrimaryAssetPathList (FPrimaryAssetType PrimaryAssetType, TArray< FSoftObjectPath > &AssetPathList) const
 Gets the list of all FSoftObjectPaths for a given type, returns true if any found
 
virtual FPrimaryAssetRules GetPrimaryAssetRules (FPrimaryAssetId PrimaryAssetId) const
 Gets the management rules for a specific asset, this will merge the type and individual values
 
bool GetPrimaryAssetsWithBundleState (TArray< FPrimaryAssetId > &PrimaryAssetList, const TArray< FPrimaryAssetType > &ValidTypes, const TArray< FName > &RequiredBundles, const TArray< FName > &ExcludedBundles=TArray< FName >(), bool bForceCurrent=false) const
 Returns a list of primary assets that are in the given bundle state. 更多...
 
virtual bool GetPrimaryAssetTypeInfo (FPrimaryAssetType PrimaryAssetType, FPrimaryAssetTypeInfo &AssetTypeInfo) const
 Gets metadata for a specific asset type, returns false if not found
 
virtual void GetPrimaryAssetTypeInfoList (TArray< FPrimaryAssetTypeInfo > &AssetTypeInfoList) const
 Gets list of all primary asset types infos
 
virtual FName GetRedirectedAssetPath (FName OldPath) const
 Reads AssetManagerSettings for specifically redirected asset paths. 更多...
 
virtual FPrimaryAssetId GetRedirectedPrimaryAssetId (const FPrimaryAssetId &OldId) const
 Tries to redirect a Primary Asset Id, using list in AssetManagerSettings
 
virtual bool GetResourceAcquireProgress (int32 &OutAcquiredCount, int32 &OutRequestedCount) const
 Returns the chunk download/install progress. 更多...
 
const class UAssetManagerSettings & GetSettings () const
 Return settings object
 
class FTimerManager * GetTimerManager () const
 Returns a timer manager that is safe to use for asset loading actions. 更多...
 
virtual bool HasInitialScanCompleted () const
 Returns true if initial scan has completed, this can be pretty late in editor builds
 
virtual bool IsAssetDataBlueprintOfClassSet (const FAssetData &AssetData, const TSet< FName > &ClassNameSet)
 Checks to see if the given asset data is a blueprint with a base class in the ClassNameSet. 更多...
 
virtual TSharedPtr< FStreamableHandle > LoadAssetList (const TArray< FSoftObjectPath > &AssetList, FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority, const FString &DebugName=TEXT("LoadAssetList"))
 Quick wrapper to async load some non primary assets with the primary streamable manager. 更多...
 
virtual TSharedPtr< FStreamableHandle > LoadPrimaryAsset (const FPrimaryAssetId &AssetToLoad, const TArray< FName > &LoadBundles=TArray< FName >(), FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Single asset wrapper
 
virtual TSharedPtr< FStreamableHandle > LoadPrimaryAssets (const TArray< FPrimaryAssetId > &AssetsToLoad, const TArray< FName > &LoadBundles=TArray< FName >(), FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Loads a list of Primary Assets. 更多...
 
virtual TSharedPtr< FStreamableHandle > LoadPrimaryAssetsWithType (FPrimaryAssetType PrimaryAssetType, const TArray< FName > &LoadBundles=TArray< FName >(), FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Loads all assets of a given type, useful for cooking
 
virtual void LoadRedirectorMaps ()
 Loads the redirector maps
 
virtual void PostInitProperties () override
 Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多...
 
virtual TSharedPtr< FStreamableHandle > PreloadPrimaryAssets (const TArray< FPrimaryAssetId > &AssetsToLoad, const TArray< FName > &LoadBundles, bool bLoadRecursive, FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=FStreamableManager::DefaultAsyncLoadPriority)
 Preloads data for a set of assets in a specific bundle state, and returns a handle you must keep active. 更多...
 
virtual void RecursivelyExpandBundleData (FAssetBundleData &BundleData) const
 This will expand out references in the passed in AssetBundleData that are pointing to other primary assets with bundles. 更多...
 
virtual int32 ScanPathForPrimaryAssets (FPrimaryAssetType PrimaryAssetType, const FString &Path, UClass *BaseClass, bool bHasBlueprintClasses, bool bIsEditorOnly=false, bool bForceSynchronousScan=true)
 Single path wrapper
 
virtual int32 ScanPathsForPrimaryAssets (FPrimaryAssetType PrimaryAssetType, const TArray< FString > &Paths, UClass *BaseClass, bool bHasBlueprintClasses, bool bIsEditorOnly=false, bool bForceSynchronousScan=true)
 Scans a list of paths and reads asset data for all primary assets of a specific type. 更多...
 
virtual void ScanPathsSynchronous (const TArray< FString > &PathsToScan) const
 Helper function which requests the asset registery scan a list of directories/assets
 
virtual void SetPrimaryAssetRules (FPrimaryAssetId PrimaryAssetId, const FPrimaryAssetRules &Rules)
 Changes the management rules for a specific asset, this overrides the type rules. 更多...
 
virtual void SetPrimaryAssetTypeRules (FPrimaryAssetType PrimaryAssetType, const FPrimaryAssetRules &Rules)
 Changes the default management rules for a specified type
 
virtual void StartBulkScanning ()
 Call this before many calls to ScanPaths to improve load performance. 更多...
 
virtual void StartInitialLoading ()
 Starts initial load, gets called from InitializeObjectReferences
 
 UAssetManager ()
 Constructor
 
virtual int32 UnloadPrimaryAsset (const FPrimaryAssetId &AssetToUnload)
 Single asset wrapper
 
virtual int32 UnloadPrimaryAssets (const TArray< FPrimaryAssetId > &AssetsToUnload)
 Unloads a list of Primary Assets that were previously Loaded. 更多...
 
virtual int32 UnloadPrimaryAssetsWithType (FPrimaryAssetType PrimaryAssetType)
 Loads all assets of a given type, useful for cooking
 
- Public 成员函数 继承自 UObject
void AbortInsideMemberFunction () const
 Abort with a member function call at the top of the callstack, helping to ensure that most platforms will stuff this object's memory into the resulting minidump.
 
virtual bool AreNativePropertiesIdenticalTo (UObject *Other) const
 Returns whether native properties are identical to the one of the passed in component. 更多...
 
virtual void BeginDestroy ()
 Called before destroying the object. 更多...
 
virtual void BuildSubobjectMapping (UObject *OtherObject, TMap< UObject *, UObject * > &ObjectMapping) const
 Given OtherObject (which will be the same type as 'this'), recursively find any matching sub-objects from 'this' that also exist within OtherObject, and add the mappings to ObjectMapping. 更多...
 
void CallAddReferencedObjects (FReferenceCollector &Collector)
 Helper function to call AddReferencedObjects for this object's class. 更多...
 
void CallFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 Internal VM method for executing a function
 
bool CallFunctionByNameWithArguments (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor, bool bForceCallWithNonExec=false)
 Handle calling a function by name when executed from the console or a command line
 
virtual bool CallRemoteFunction (UFunction *Function, void *Parms, struct FOutParmRec *OutParms, FFrame *Stack)
 Call the actor's function remotely 更多...
 
bool CheckDefaultSubobjects (bool bForceCheck=false) const
 Checks default sub-object assumptions. 更多...
 
void CollectDefaultSubobjects (TArray< UObject * > &OutDefaultSubobjects, bool bIncludeNestedSubobjects=false) const
 Uses the TArchiveObjectReferenceCollector to build a list of all components referenced by this object which have this object as the outer 更多...
 
bool ConditionalBeginDestroy ()
 Called before destroying the object. 更多...
 
bool ConditionalFinishDestroy ()
 Called when an object is actually destroyed, memory should never be accessed again
 
void ConditionalPostLoad ()
 PostLoad if needed.
 
void ConditionalPostLoadSubobjects (struct FObjectInstancingGraph *OuterInstanceGraph=NULL)
 Instances subobjects and components for objects being loaded from disk, if necessary. 更多...
 
 DECLARE_FUNCTION (execBreakpoint)
 Breakpoint; only observed in the editor; executing it at any other time is a NOP
 
 DECLARE_FUNCTION (execInstrumentation)
 Instrumentation event for profiling; only observed in the builds with blueprint instrumentation
 
 DECLARE_FUNCTION (execPopExecutionFlow)
 Pops a code offset from the execution flow stack and starts execution there. 更多...
 
 DECLARE_FUNCTION (execPopExecutionFlowIfNot)
 Pops a code offset from the execution flow stack and starts execution there, if a condition is not true. 更多...
 
 DECLARE_FUNCTION (execPushExecutionFlow)
 Push a code offset onto the execution flow stack for future execution. 更多...
 
 DECLARE_FUNCTION (execReturnNothing)
 failsafe for functions that return a value - returns the zero value for a property and logs that control reached the end of a non-void function
 
 DECLARE_FUNCTION (execTracepoint)
 Tracepoint; only observed in the editor; executing it at any other time is a NOP
 
 DECLARE_FUNCTION (ProcessInternal)
 Internal function call processing. 更多...
 
void DestroyNonNativeProperties ()
 Destroy properties that won't be destroyed by the native destructor
 
void ExecuteUbergraph (int32 EntryPoint)
 Execute the ubergraph from a specific entry point
 
virtual void ExportCustomProperties (FOutputDevice &Out, uint32 Indent)
 Exports the property values for the specified object as text to the output device. 更多...
 
UFunction * FindFunction (FName InName) const
 Returns a UFunction with the specified name, wrapper for UClass::FindFunctionByName()
 
UFunction * FindFunctionChecked (FName InName) const
 Version of FindFunction() that will assert if the function was not found
 
virtual void FinishDestroy ()
 Called to finish destroying the object. 更多...
 
UObject * GetArchetype () const
 Return the template this object is based on. 更多...
 
void GetArchetypeInstances (TArray< UObject * > &Instances)
 Builds a list of objects which have this object in their archetype chain. 更多...
 
virtual void GetAssetRegistryTags (TArray< FAssetRegistryTag > &OutTags) const
 Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects 更多...
 
virtual const TCHAR * GetConfigOverridePlatform () const
 Returns the override config hierarchy platform (if NDAd platforms need defaults to not be in Base*.ini but still want editor to load them)
 
FString GetDefaultConfigFilename () const
 Get the default config filename for the specified UObject
 
virtual FString GetDesc ()
 Return a one line description of an object for viewing in the thumbnail view of the generic browser
 
FString GetDetailedInfo () const
 This will return detail info about this specific object. 更多...
 
virtual FName GetExporterName (void)
 Returns the name of the exporter factory used to export this object Used when multiple factories have the same extension
 
virtual int32 GetFunctionCallspace (UFunction *Function, FFrame *Stack)
 Return the space this function should be called. 更多...
 
FString GetGlobalUserConfigFilename () const
 Get the global user override config filename for the specified UObject
 
virtual void GetLifetimeReplicatedProps (TArray< class FLifetimeProperty > &OutLifetimeProps) const
 Returns properties that are replicated for the lifetime of the actor channel
 
virtual bool GetNativePropertyValues (TMap< FString, FString > &out_PropertyValues, uint32 ExportFlags=0) const
 Callback for retrieving a textual representation of natively serialized properties. 更多...
 
virtual int32 GetNetPushIdDynamic () const
 Should only ever be used by internal systems.
 
virtual void GetPreloadDependencies (TArray< UObject * > &OutDeps)
 Called during cooking. 更多...
 
virtual void GetPrestreamPackages (TArray< UObject * > &OutPrestream)
 Called during cooking. 更多...
 
virtual FPrimaryAssetId GetPrimaryAssetId () const
 Returns an Type:Name pair representing the PrimaryAssetId for this object. 更多...
 
FString GetProjectUserConfigFilename () const
 Get the project user override config filename for the specified UObject
 
SIZE_T GetResourceSizeBytes (EResourceSizeMode::Type Mode)
 Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the simple version which just returns the total number of bytes used by this object. 更多...
 
virtual void GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize)
 Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific). 更多...
 
virtual FRestoreForUObjectOverwrite * GetRestoreForUObjectOverwrite ()
 Save information for StaticAllocateObject in the case of overwriting an existing object. 更多...
 
virtual UScriptStruct * GetSparseClassDataStruct () const
 Return the UStruct corresponding to the sidecar data structure that stores data that is constant for all instances of this class.
 
virtual void GetSubobjectsWithStableNamesForNetworking (TArray< UObject * > &ObjList)
 Returns a list of sub-objects that have stable names for networking
 
template<class T >
FORCEINLINE bool Implements () const
 Returns true if this object implements the interface T, false otherwise.
 
template<class T >
bool Implements () const
 Returns true if this object implements the interface T, false otherwise.
 
virtual void ImportCustomProperties (const TCHAR *SourceText, FFeedbackContext *Warn)
 Exports the property values for the specified object as text to the output device. 更多...
 
void InstanceSubobjectTemplates (struct FObjectInstancingGraph *InstanceGraph=NULL)
 Wrapper for calling UClass::InstanceSubobjectTemplates() for this object.
 
virtual bool IsAsset () const
 Returns true if this object is considered an asset.
 
bool IsBasedOnArchetype (const UObject *const SomeObject) const
 Determine if this object has SomeObject in its archetype chain.
 
virtual bool IsDestructionThreadSafe () const
 Called during garbage collection to determine if an object can have its destructor called on a worker thread. 更多...
 
virtual bool IsEditorOnly () const
 Called during saving to determine if the object is forced to be editor only or not 更多...
 
virtual bool IsFullNameStableForNetworking () const
 IsFullNameStableForNetworking means an object can be referred to its full path name over the network
 
bool IsInBlueprint () const
 Returns whether this object is contained in or part of a blueprint object
 
virtual bool IsLocalizedResource () const
 Returns true if this object is considered a localized resource.
 
virtual bool IsNameStableForNetworking () const
 IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network
 
virtual bool IsPostLoadThreadSafe () const
 Called during async load to determine if PostLoad can be called on the loading thread. 更多...
 
virtual bool IsReadyForAsyncPostLoad () const
 Called before calling PostLoad() in FAsyncPackage::PostLoadObjects(). 更多...
 
virtual bool IsReadyForFinishDestroy ()
 Called to check if the object is ready for FinishDestroy. 更多...
 
virtual bool IsSafeForRootSet () const
 Returns true if this object is safe to add to the root set.
 
bool IsSelected () const
 Test the selection state of a UObject 更多...
 
virtual bool IsSupportedForNetworking () const
 IsSupportedForNetworking means an object can be referenced over the network
 
void LoadConfig (UClass *ConfigClass=NULL, const TCHAR *Filename=NULL, uint32 PropagationFlags=UE4::LCPF_None, class FProperty *PropertyToLoad=NULL)
 Imports property values from an .ini file. 更多...
 
virtual void MarkAsEditorOnlySubobject ()
 Called during subobject creation to mark this component as editor only, which causes it to get stripped in packaged builds
 
FORCEINLINE bool Modify (bool bAlwaysMarkDirty=true)
 Note that the object will be modified. 更多...
 
virtual bool NeedsLoadForClient () const
 Called during saving to determine the load flags to save with the object. 更多...
 
virtual bool NeedsLoadForEditorGame () const
 Called during saving to include this object in client/servers running in editor builds, even if they wouldn't normally be. 更多...
 
virtual bool NeedsLoadForServer () const
 Called during saving to determine the load flags to save with the object. 更多...
 
virtual bool NeedsLoadForTargetPlatform (const class ITargetPlatform *TargetPlatform) const
 Called during saving to determine the load flags to save with the object. 更多...
 
void OutputReferencers (FOutputDevice &Ar, FReferencerInformationList *Referencers=NULL)
 Outputs a string to an arbitrary output device, describing the list of objects which are holding references to this one. 更多...
 
virtual void OverridePerObjectConfigSection (FString &SectionName)
 Allows PerObjectConfig classes, to override the ini section name used for the PerObjectConfig object. 更多...
 
void ParseParms (const TCHAR *Parms)
 Import an object from a file.
 
virtual void PostCDOContruct ()
 Called after the C++ constructor has run on the CDO for a class. 更多...
 
virtual void PostDuplicate (bool bDuplicateForPIE)
 Called after duplication & serialization and before PostLoad. 更多...
 
virtual void PostEditImport ()
 Called after importing property values for this object (paste, duplicate or .t3d import) Allow the object to perform any cleanup for properties which shouldn't be duplicated or are unsupported by the script serialization
 
virtual void PostInitProperties ()
 Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多...
 
virtual void PostInterpChange (FProperty *PropertyThatChanged)
 This is called when property is modified by InterpPropertyTracks 更多...
 
virtual void PostLoad ()
 Do any object-specific cleanup required immediately after loading an object. 更多...
 
virtual void PostLoadSubobjects (FObjectInstancingGraph *OuterInstanceGraph)
 Instances components for objects being loaded from disk, if necessary. 更多...
 
virtual void PostNetReceive ()
 Called right after receiving a bunch
 
virtual void PostReloadConfig (class FProperty *PropertyThatWasLoaded)
 Called from ReloadConfig after the object has reloaded its configuration data.
 
virtual void PostRename (UObject *OldOuter, const FName OldName)
 Called at the end of Rename(), but only if the rename was actually carried out
 
virtual void PostRepNotifies ()
 Called right after calling all OnRep notifies (called even when there are no notifies)
 
virtual void PostSaveRoot (bool bCleanupIsRequired)
 Called from within SavePackage on the passed in base/root object. 更多...
 
virtual void PreDestroyFromReplication ()
 Called right before being marked for destruction due to network replication
 
virtual void PreDuplicate (FObjectDuplicationParameters &DupParams)
 Called before duplication. 更多...
 
virtual void PreNetReceive ()
 Called right before receiving a bunch
 
virtual void PreSave (const class ITargetPlatform *TargetPlatform)
 Presave function. 更多...
 
virtual bool PreSaveRoot (const TCHAR *Filename)
 Called from within SavePackage on the passed in base/root object. 更多...
 
virtual bool ProcessConsoleExec (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor)
 This function handles a console exec sent to the object; it is virtual so 'nexus' objects like a player controller can reroute the command to several different objects.
 
virtual void ProcessEvent (UFunction *Function, void *Parms)
 Called by VM to execute a UFunction with a filled in UStruct of parameters
 
virtual UClass * RegenerateClass (UClass *ClassToRegenerate, UObject *PreviousCDO)
 Called on the target when a class is loaded with ClassGeneratedBy is loaded. 更多...
 
void ReinitializeProperties (UObject *SourceObject=NULL, struct FObjectInstancingGraph *InstanceGraph=NULL)
 Wrapper function for InitProperties() which handles safely tearing down this object before re-initializing it from the specified source object. 更多...
 
void ReloadConfig (UClass *ConfigClass=NULL, const TCHAR *Filename=NULL, uint32 PropagationFlags=UE4::LCPF_None, class FProperty *PropertyToLoad=NULL)
 Wrapper method for LoadConfig that is used when reloading the config data for objects at runtime which have already loaded their config data at least once. 更多...
 
virtual bool Rename (const TCHAR *NewName=nullptr, UObject *NewOuter=nullptr, ERenameFlags Flags=REN_None)
 Rename this object to a unique name, or change its outer. 更多...
 
void RetrieveReferencers (TArray< FReferencerInformation > *OutInternalReferencers, TArray< FReferencerInformation > *OutExternalReferencers)
 Called by OutputReferencers() to get the internal list of referencers to write
 
void SaveConfig (uint64 Flags=CPF_Config, const TCHAR *Filename=NULL, FConfigCacheIni *Config=GConfig, bool bAllowCopyToDefaultObject=true)
 Save configuration out to ini files 更多...
 
virtual void Serialize (FArchive &Ar)
 Handles reading, writing, and reference collecting using FArchive. 更多...
 
void SerializeScriptProperties (FArchive &Ar) const
 Serializes the script property data located at Data. 更多...
 
void SerializeScriptProperties (FStructuredArchive::FSlot Slot) const
 Serializes the script property data located at Data. 更多...
 
void SetLinker (FLinkerLoad *LinkerLoad, int32 LinkerIndex, bool bShouldDetachExisting=true)
 Changes the linker and linker index to the passed in one. 更多...
 
virtual void ShutdownAfterError ()
 After a critical error, perform any mission-critical cleanup, such as restoring the video mode orreleasing hardware resources.
 
void SkipFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 advances Stack's code past the parameters to the given Function and if the function has a return value, copies the zero value for that property to the memory for the return value 更多...
 
virtual void TagSubobjects (EObjectFlags NewFlags)
 Tags objects that are part of the same asset with the specified object flag, used for GC checking 更多...
 
void UpdateDefaultConfigFile (const FString &SpecificFileLocation="")
 Saves just the section(s) for this class into the default ini file for the class (with just the changes from base)
 
void UpdateGlobalUserConfigFile ()
 Saves just the section(s) for this class into the global user ini file for the class (with just the changes from base)
 
void UpdateProjectUserConfigFile ()
 Saves just the section(s) for this class into the project user ini file for the class (with just the changes from base)
 
void UpdateSinglePropertyInConfigFile (const FProperty *InProperty, const FString &InConfigIniName)
 Saves just the property into the global user ini file for the class (with just the changes from base)
 
- Public 成员函数 继承自 UObjectBaseUtility
void AddToCluster (UObjectBaseUtility *ClusterRootOrObjectFromCluster, bool bAddAsMutableObject=false)
 Adds this objects to a GC cluster that already exists 更多...
 
FORCEINLINE void AddToRoot ()
 Add an object to the root set. 更多...
 
FORCEINLINE void AppendName (FString &ResultString) const
 Optimized version of GetName that appends to an existing string
 
FORCEINLINE bool AtomicallyClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 Atomically clears passed in internal flags. 更多...
 
virtual bool CanBeClusterRoot () const
 Called after load to determine if the object can be a cluster root 更多...
 
virtual bool CanBeInCluster () const
 Called during cluster construction if the object can be added to a cluster 更多...
 
FORCEINLINE void ClearFlags (EObjectFlags NewFlags)
 Clears subset of flags for a specific object
 
FORCEINLINE void ClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 Clears passed in internal flags. 更多...
 
FORCEINLINE void ClearPendingKill ()
 Unmarks this object as PendingKill.
 
virtual void CreateCluster ()
 Called after PostLoad to create UObject cluster
 
void DetachExternalPackage ()
 Utility function to temporarily detach the object external package, if any GetPackage will report the outer's package once detached
 
const UClass * FindNearestCommonBaseClass (const UClass *TestClass) const
 Finds the most-derived class which is a parent of both TestClass and this object's class. 更多...
 
FORCEINLINE EObjectMark GetAllMarks () const
 Returns all of the object marks on a specific object 更多...
 
FString GetFullGroupName (bool bStartWithOuter) const
 Walks up the chain of packages until it reaches the top level, which it ignores. 更多...
 
void GetFullName (const UObject *StopOuter, FString &ResultString, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 Version of GetFullName() that eliminates unnecessary copies.
 
FString GetFullName (const UObject *StopOuter=NULL, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 Returns the fully qualified pathname for this object as well as the name of the class, in the format: 'ClassName Outermost[.Outer].Name'. 更多...
 
void * GetInterfaceAddress (UClass *InterfaceClass)
 Returns a pointer to this object safely converted to a pointer of the specified interface class. 更多...
 
FORCEINLINE EInternalObjectFlags GetInternalFlags () const
 Gets internal flags. 更多...
 
class FLinkerLoad * GetLinker () const
 Returns the linker for this object. 更多...
 
int32 GetLinkerCustomVersion (FGuid CustomVersionKey) const
 Returns the custom version of the linker for this object corresponding to the given custom version key. 更多...
 
int32 GetLinkerIndex () const
 Returns this object's LinkerIndex. 更多...
 
int32 GetLinkerLicenseeUE4Version () const
 Returns the licensee version of the linker for this object. 更多...
 
int32 GetLinkerUE4Version () const
 Returns the UE4 version of the linker for this object. 更多...
 
FORCEINLINE EObjectFlags GetMaskedFlags (EObjectFlags Mask=RF_AllFlags) const
 Returns object flags that are both in the mask and set on the object. 更多...
 
FORCEINLINE FString GetName () const
 Returns the name of this object (with no path information) 更多...
 
FORCEINLINE void GetName (FString &ResultString) const
 Optimized version of GetName that overwrites an existing string
 
void * GetNativeInterfaceAddress (UClass *InterfaceClass)
 Returns a pointer to the I* native interface object that this object implements. 更多...
 
const void * GetNativeInterfaceAddress (UClass *InterfaceClass) const
 Returns a pointer to the const I* native interface object that this object implements. 更多...
 
UPackage * GetOutermost () const
 Legacy function, has the same behavior as GetPackage use GetPackage instead. 更多...
 
UObject * GetOutermostObject () const
 Walks up the list of outers until it finds the top-level one that isn't a package. 更多...
 
UPackage * GetPackage () const
 Walks up the list of outers until it finds a package directly associated with the object. 更多...
 
void GetPathName (const UObject *StopOuter, FString &ResultString) const
 Versions of GetPathName() that eliminates unnecessary copies and allocations.
 
FString GetPathName (const UObject *StopOuter=NULL) const
 Returns the fully qualified pathname for this object, in the format: 'Outermost[.Outer].Name' 更多...
 
FORCEINLINE TStatId GetStatID (bool bForDeferredUse=false) const
 Returns the stat ID of the object, used for profiling. 更多...
 
template<typename T >
T * GetTypedOuter () const
 Traverses the outer chain searching for the next object of a certain type. 更多...
 
UObject * GetTypedOuter (UClass *Target) const
 Traverses the outer chain searching for the next object of a certain type. 更多...
 
FORCEINLINE bool HasAllFlags (EObjectFlags FlagsToCheck) const
 Used to safely check whether all of the passed in flags are set. 更多...
 
FORCEINLINE bool HasAllMarks (EObjectMark Marks) const
 Tests an object for having ALL of a set of marks 更多...
 
FORCEINLINE bool HasAnyFlags (EObjectFlags FlagsToCheck) const
 Used to safely check whether any of the passed in flags are set. 更多...
 
FORCEINLINE bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
 Used to safely check whether any of the passed in internal flags are set. 更多...
 
FORCEINLINE bool HasAnyMarks (EObjectMark Marks) const
 Tests an object for having ANY of a set of marks 更多...
 
template<class T >
bool IsA () const
 Returns true if this object is of the template type.
 
template<typename OtherClassType >
FORCEINLINE bool IsA (OtherClassType SomeBase) const
 Returns true if this object is of the specified type.
 
bool IsDefaultSubobject () const
 Returns whether this component was instanced from a component/subobject template, or if it is a component/subobject template. 更多...
 
bool IsIn (const UObject *SomeOuter) const
 Return the dispatch to IsInOuter or IsInPackage depending on SomeOuter's class. 更多...
 
bool IsIn (const UPackage *SomePackage) const
 Overload to determine if an object is in the specified package which can now be different than its outer chain. 更多...
 
bool IsInA (const UClass *SomeBaseClass) const
 Find out if this object is inside (has an outer) that is of the specified class 更多...
 
bool IsInOuter (const UObject *SomeOuter) const
 Returns true if the object is contained in the specified outer.
 
bool IsInPackage (const UPackage *SomePackage) const
 Returns true if the object is contained in the specified package.
 
FORCEINLINE bool IsNative () const
 Checks if the object is native.
 
FORCEINLINE bool IsPendingKill () const
 Checks the PendingKill flag to see if it is dead but memory still valid
 
FORCEINLINE bool IsPendingKillOrUnreachable () const
 Checks if the object is pending kill or unreachable.
 
FORCEINLINE bool IsRooted () const
 Returns true if this object is explicitly rooted 更多...
 
bool IsTemplate (EObjectFlags TemplateTypes=RF_ArchetypeObject|RF_ClassDefaultObject) const
 Determines whether this object is a template object 更多...
 
FORCEINLINE bool IsUnreachable () const
 Checks if the object is unreachable.
 
FORCEINLINE void Mark (EObjectMark Marks) const
 Adds marks to an object 更多...
 
bool MarkPackageDirty () const
 Finds the outermost package and marks it dirty. 更多...
 
FORCEINLINE void MarkPendingKill ()
 Marks this object as RF_PendingKill.
 
virtual void OnClusterMarkedAsPendingKill ()
 Called during Garbage Collection to perform additional cleanup when the cluster is about to be destroyed due to PendingKill flag being set on it.
 
FORCEINLINE bool operator< (const UObjectBaseUtility &Other) const
 Overloaded < operator. 更多...
 
void ReattachExternalPackage ()
 Utility function to reattach the object external package, if any GetPackage will report the object external package if set after this call
 
FORCEINLINE void RemoveFromRoot ()
 Remove an object from the root set.
 
bool RootPackageHasAnyFlags (uint32 CheckFlagMask) const
 Checks whether this object's top-most package has any of the specified flags 更多...
 
FORCEINLINE void SetFlags (EObjectFlags NewFlags)
 Modifies object flags for a specific object
 
FORCEINLINE void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
 Clears passed in internal flags. 更多...
 
FORCEINLINE bool ThisThreadAtomicallyClearedRFUnreachable ()
 Atomically clear the unreachable flag 更多...
 
FORCEINLINE void UnMark (EObjectMark Marks) const
 Removes marks from and object 更多...
 
- Public 成员函数 继承自 UObjectBase
FORCENOINLINE void AtomicallyClearFlags (EObjectFlags FlagsToClear)
 Atomically clears the specified flags. 更多...
 
FORCENOINLINE void AtomicallySetFlags (EObjectFlags FlagsToAdd)
 Atomically adds the specified flags. 更多...
 
FORCEINLINE UClass * GetClass () const
 Returns the UClass that defines the fields of this object
 
UPackage * GetExternalPackage () const
 Returns the external UPackage associated with this object, if any
 
UPackage * GetExternalPackageInternal () const
 Returns the external UPackage for this object, if any, NOT THREAD SAFE, used by internal gc reference collecting.
 
FORCEINLINE EObjectFlags GetFlags () const
 Retrieve the object flags directly 更多...
 
FORCEINLINE FName GetFName () const
 Returns the logical name of this object
 
FORCEINLINE UObject * GetOuter () const
 Returns the UObject this object resides in
 
FORCEINLINE uint32 GetUniqueID () const
 Returns the unique ID of the object...these are reused so it is only unique while the object is alive. 更多...
 
bool IsValidLowLevel () const
 Checks to see if the object appears to be valid 更多...
 
bool IsValidLowLevelFast (bool bRecursive=true) const
 Faster version of IsValidLowLevel. 更多...
 
void SetExternalPackage (UPackage *InPackage)
 Associate an external package directly to this object.
 
 UObjectBase (UClass *InClass, EObjectFlags InFlags, EInternalObjectFlags InInternalFlags, UObject *InOuter, FName InName)
 Constructor used by StaticAllocateObject 更多...
 
virtual ~UObjectBase ()
 Final destructor, removes the object from the object array, and indirectly, from any annotations
 

静态 Public 成员函数

static FPrimaryAssetId CreatePrimaryAssetIdFromChunkId (int32 ChunkId)
 Creates a PrimaryAssetId from a chunk id
 
static void DumpAssetRegistryInfo ()
 Dumps information about the Asset Registry to log
 
static void DumpAssetTypeSummary ()
 Dumps out summary of managed types to log
 
static void DumpBundlesForAsset (const TArray< FString > &Args)
 Shows a list of all bundles for the specified primary asset by primary asset id (i.e. 更多...
 
static void DumpLoadedAssetState ()
 Dumps out list of loaded asset bundles to log
 
static void DumpReferencersForPackage (const TArray< FString > &PackageNames)
 Dumps out list of primary asset -> managed assets to log
 
static int32 ExtractChunkIdFromPrimaryAssetId (const FPrimaryAssetId &PrimaryAssetId)
 Extracts a chunk id from a primary asset id, returns INDEX_NONE if it is not PackageChunkType
 
static UAssetManager & Get ()
 Returns the current AssetManager object
 
static FName GetEncryptionKeyAssetTagName ()
 Get the asset registry tag name for encryption key data
 
static UAssetManager * GetIfValid ()
 Returns the current AssetManager object if it exists, null otherwise
 
static FStreamableManager & GetStreamableManager ()
 Accesses the StreamableManager used by this Asset Manager. 更多...
 
static bool IsValid ()
 Returns true if there is a current asset manager
 
- 静态 Public 成员函数 继承自 UObject
static void AddReferencedObjects (UObject *InThis, FReferenceCollector &Collector)
 Callback used to allow object register its direct object references that are not already covered by the token stream. 更多...
 
static bool CanCreateInCurrentContext (UObject *Template)
 Determines if you can create an object from the supplied template in the current context (editor, client only, dedicated server, game/listen) This calls NeedsLoadForClient & NeedsLoadForServer
 
static UObject * GetArchetypeFromRequiredInfo (const UClass *Class, const UObject *Outer, FName Name, EObjectFlags ObjectFlags)
 Return the template that an object with this class, outer and name would be 更多...
 
static const FName & SourceFileTagName ()
 Get the common tag name used for all asset source file import paths
 
static void UpdateClassesExcludedFromDedicatedClient (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 Update the list of classes that we should exclude from dedicated client builds
 
static void UpdateClassesExcludedFromDedicatedServer (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 Update the list of classes that we should exclude from dedicated server builds
 
- 静态 Public 成员函数 继承自 UObjectBase
static void EmitBaseReferences (UClass *RootClass)
 Emit GC tokens for UObjectBase, this might be UObject::StaticClass or Default__Class
 
static FString RemoveClassPrefix (const TCHAR *ClassName)
 Removes the class prefix from the given string
 

静态 Public 属性

static const FPrimaryAssetType MapType
 Asset Type of UWorld assets
 
static const FPrimaryAssetType PackageChunkType
 Type representing a packaging chunk, this is a virtual type that is never loaded off disk
 
static const FPrimaryAssetType PrimaryAssetLabelType
 Asset Type of Label used to tag other assets
 

Protected 成员函数

virtual void AcquireChunkList (const TArray< int32 > &ChunkList, FAssetManagerAcquireResourceDelegate CompleteDelegate, EChunkPriority::Type Priority, TSharedPtr< FStreamableHandle > StalledHandle)
 Call to start acquiring a list of chunks
 
virtual void ApplyCustomPrimaryAssetRulesOverride (const FPrimaryAssetRulesCustomOverride &CustomOverride)
 Apply a single custom primary asset rule, calls function below
 
virtual bool DoesPrimaryAssetMatchCustomOverride (FPrimaryAssetId PrimaryAssetId, const FPrimaryAssetRulesCustomOverride &CustomOverride) const
 Sees if a specific primary asset passes the custom override filter, subclass this to handle FilterString
 
virtual void GetAssetDataForPathInternal (class IAssetRegistry &AssetRegistry, const FString &AssetPath, OUT FAssetData &OutAssetData) const
 Internal helper function that attempts to get asset data from the specified path; Accounts for possibility of blueprint classes ending in _C
 
FPrimaryAssetData * GetNameData (const FPrimaryAssetId &PrimaryAssetId, bool bCheckRedirector=true)
 Returns the NameData for a specific type/name pair
 
virtual bool IsPathExcludedFromScan (const FString &Path) const
 Returns true if path should be excluded from primary asset scans
 
bool OnAssetRegistryAvailableAfterInitialization (FName InName, FAssetRegistryState &OutNewState)
 Called when a new asset registry becomes available 更多...
 
virtual void OnAssetStateChangeCompleted (FPrimaryAssetId PrimaryAssetId, TSharedPtr< FStreamableHandle > BoundHandle, FStreamableDelegate WrappedDelegate)
 Called when an internal load handle finishes, handles setting to pending state
 
virtual void OnChunkDownloaded (uint32 ChunkId, bool bSuccess)
 Called when a new chunk has been downloaded
 
virtual void PostInitialAssetScan ()
 Called after scanning is complete, either from FinishInitialLoading or after the AssetRegistry finishes
 
virtual void RebuildObjectReferenceList ()
 Rebuilds the ObjectReferenceList, needed after global object state has changed
 
virtual void ScanPrimaryAssetRulesFromConfig ()
 Called to apply the primary asset rule overrides from config
 
virtual void ScanPrimaryAssetTypesFromConfig ()
 Scans all asset types specified in DefaultGame
 
virtual void SearchAssetRegistryPaths (TArray< FAssetData > &OutAssetDataList, TSet< FName > &OutDerivedClassNames, const TArray< FString > &Directories, const TArray< FString > &PackageNames, UClass *BaseClass, bool bHasBlueprintClasses) const
 Helper function to read the asset registry
 
virtual bool ShouldScanPrimaryAssetType (FPrimaryAssetTypeInfo &TypeInfo) const
 Returns true if the specified TypeInfo should be scanned. 更多...
 
virtual void UpdateCachedAssetData (const FPrimaryAssetId &PrimaryAssetId, const FAssetData &NewAssetData, bool bAllowDuplicates)
 Updates the asset data cached on the name data
 
virtual bool WriteCustomReport (FString FileName, TArray< FString > &FileLines) const
 Helper function to write out asset reports
 
- Protected 成员函数 继承自 UObject
bool CanCheckDefaultSubObjects (bool bForceCheck, bool &bResult) const
 Checks it's ok to perform subobjects check at this time.
 
virtual bool CheckDefaultSubobjectsInternal () const
 Checks default sub-object assumptions. 更多...
 
virtual FString GetDetailedInfoInternal () const
 This function actually does the work for the GetDetailedInfo() and is virtual. 更多...
 
- Protected 成员函数 继承自 UObjectBase
virtual void DeferredRegister (UClass *UClassStaticClass, const TCHAR *PackageName, const TCHAR *Name)
 Convert a boot-strap registered class into a real one, add to uobject array, etc 更多...
 
void LowLevelRename (FName NewName, UObject *NewOuter=NULL)
 Just change the FName and Outer and rehash into name hash tables. 更多...
 
void Register (const TCHAR *PackageName, const TCHAR *Name)
 Enqueue the registration for this object.
 
virtual void RegisterDependencies ()
 Force any base classes to be registered first
 
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
 Set the object flags directly 更多...
 
 UObjectBase (EObjectFlags InFlags)
 Constructor used for bootstrapping 更多...
 

Protected 属性

TArray< FString > AlreadyScannedDirectories
 List of directories that have already been synchronously scanned
 
TMap< FName, FPrimaryAssetId > AssetPathMap
 Map from object path to Primary Asset Id
 
TMap< FPrimaryAssetId, FPrimaryAssetRulesExplicitOverride > AssetRuleOverrides
 Overridden asset management data for specific types
 
bool bHasCompletedInitialScan
 True if we have passed the initial asset registry/type scan
 
bool bIncludeOnlyOnDiskAssets
 True if only on-disk assets should be searched by the asset registry
 
bool bIsBulkScanning
 True if we are currently in bulk scanning mode
 
bool bIsGlobalAsyncScanEnvironment
 True if we are running a build that is already scanning assets globally so we can perhaps avoid scanning paths synchronously
 
bool bIsLoadingFromPakFiles
 True if we are loading from pak files
 
bool bIsManagementDatabaseCurrent
 True if the asset management database is up to date
 
bool bIsPrimaryAssetDirectoryCurrent
 True if asset data is current, if false it will need to rescan before PIE
 
bool bOnlyCookProductionAssets
 If true, DevelopmentCook assets will error when they are cooked
 
bool bShouldAcquireMissingChunksOnLoad
 True if the chunk install interface should be queries before loading assets
 
bool bShouldGuessTypeAndName
 True if PrimaryAssetType/Name will be implied for loading assets that don't have it saved on disk. 更多...
 
bool bShouldUseSynchronousLoad
 True if we should always use synchronous loads, this speeds up cooking
 
bool bUpdateManagementDatabaseAfterScan
 True if the asset management database should be updated after scan completes
 
TMap< FPrimaryAssetId, TMap< FName, FAssetBundleEntry > > CachedAssetBundles
 Cached map of asset bundles, global and per primary asset
 
FDelegateHandle ChunkInstallDelegateHandle
 Delegate bound to chunk install
 
TMap< FPrimaryAssetId, TArray< FPrimaryAssetId > > ManagementParentMap
 Map from PrimaryAssetId to list of PrimaryAssetIds that are the parent of this one, for determining chunking/cooking
 
int32 NumberOfSpawnedNotifications
 Number of notifications seen in this update
 
TArray< UObject * > ObjectReferenceList
 List of UObjects that are being kept from being GCd, derived from the asset type map. 更多...
 
FSimpleMulticastDelegate OnCompletedInitialScanDelegate
 Delegate called when initial span finishes
 
TArray< FPendingChunkInstall > PendingChunkInstalls
 List of chunk installs that are being waited for
 
TMap< FPrimaryAssetId, FGuid > PrimaryAssetEncryptionKeyCache
 Cache of encryption keys used by each primary asset
 
TMap< FName, FName > PrimaryAssetTypeRedirects
 Redirector maps loaded out of AssetMigrations.ini
 
FStreamableManager StreamableManager
 The streamable manager used for all primary asset loading
 

额外继承的成员函数

- 静态 Protected 成员函数 继承自 UObjectBaseUtility
static void CreateClusterFromObject (UObjectBaseUtility *ClusterRootObject, UObjectBaseUtility *ReferencingObject)
 Helper function to create a cluster from UObject
 

详细描述

A singleton UObject that is responsible for loading and unloading PrimaryAssets, and maintaining game-specific asset references Games should override this class and change the class reference

成员函数说明

◆ AcquireResourcesForAssetList()

virtual void UAssetManager::AcquireResourcesForAssetList ( const TArray< FSoftObjectPath > &  AssetList,
FAssetManagerAcquireResourceDelegateEx  CompleteDelegate,
EChunkPriority::Type  Priority = EChunkPriority::Immediate 
)
virtual

Acquires a set of chunks using the platform chunk layer, then calls the passed in callback

参数
AssetListAsset Paths to get resources for
CompleteDelegateDelegate called when chunks have been acquired or failed. If any chunks fail the entire operation is considered a failure
PriorityPriority to use when acquiring chunks

◆ AcquireResourcesForPrimaryAssetList()

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

Acquires a set of chunks using the platform chunk layer, then calls the passed in callback.

This will download all bundles of a primary asset

参数
PrimaryAssetListPrimary assets to get chunks for
CompleteDelegateDelegate called when chunks have been acquired or failed. If any chunks fail the entire operation is considered a failure
PriorityPriority to use when acquiring chunks

◆ AddDynamicAsset()

virtual bool UAssetManager::AddDynamicAsset ( const FPrimaryAssetId &  PrimaryAssetId,
const FSoftObjectPath &  AssetPath,
const FAssetBundleData &  BundleData 
)
virtual

Adds or updates a Dynamic asset, which is a runtime-specified asset that has no on disk representation, so has no FAssetData.

But it can have bundle state and a path.

参数
FPrimaryAssetIdType/Name of the asset. The type info will be created if it doesn't already exist
AssetPathPath to the object representing this asset, this is optional for dynamic assets
BundleDataList of Name->asset paths that represent the possible bundle states for this asset
返回
True if added

◆ ChangeBundleStateForMatchingPrimaryAssets()

virtual TSharedPtr< FStreamableHandle > UAssetManager::ChangeBundleStateForMatchingPrimaryAssets ( const TArray< FName > &  NewBundles,
const TArray< FName > &  OldBundles,
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = FStreamableManager::DefaultAsyncLoadPriority 
)
virtual

Changes the bundle state of all loaded primary assets.

Only assets matching OldBundles will be modified You can wait on the returned streamable request or poll as needed. If there is no work to do, returned handle will be null and delegate will get called before function returns.

参数
NewBundlesNew bundle state for the assets that are changed
OldBundlesOld bundle state, it will remove these bundles and replace with NewBundles
DelegateToCallDelegate that will be called on completion, may be called before function returns if assets are already loaded
PriorityAsync loading priority for this request
返回
Streamable Handle that can be used to poll or wait. You do not need to keep this handle to stop the assets from being unloaded

◆ ChangeBundleStateForPrimaryAssets()

virtual TSharedPtr< FStreamableHandle > UAssetManager::ChangeBundleStateForPrimaryAssets ( const TArray< FPrimaryAssetId > &  AssetsToChange,
const TArray< FName > &  AddBundles,
const TArray< FName > &  RemoveBundles,
bool  bRemoveAllBundles = false,
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = FStreamableManager::DefaultAsyncLoadPriority 
)
virtual

Changes the bundle state of a set of loaded primary assets.

You can wait on the returned streamable request or poll as needed. If there is no work to do, returned handle will be null and delegate will get called before function returns.

参数
AssetsToChangeList of primary assets to change state of
AddBundlesList of bundles to add
RemoveBundlesExplicit list of bundles to remove
RemoveAllBundlesIf true, remove all existing bundles even if not in remove list
DelegateToCallDelegate that will be called on completion, may be called before function returns if assets are already loaded
PriorityAsync loading priority for this request
返回
Streamable Handle that can be used to poll or wait. You do not need to keep this handle to stop the assets from being unloaded

◆ DeterminePrimaryAssetIdForObject()

virtual FPrimaryAssetId UAssetManager::DeterminePrimaryAssetIdForObject ( const UObject *  Object)
virtual

If bShouldManagerDetermineTypeAndName is true in settings, this function is used to determine the primary asset id for any object that does not have it's own implementation.

Games can override the behavior here or call it from other places

◆ DumpBundlesForAsset()

static void UAssetManager::DumpBundlesForAsset ( const TArray< FString > &  Args)
static

Shows a list of all bundles for the specified primary asset by primary asset id (i.e.

Map:Entry)

◆ ExtractPrimaryAssetIdFromData()

virtual FPrimaryAssetId UAssetManager::ExtractPrimaryAssetIdFromData ( const FAssetData &  AssetData,
FPrimaryAssetType  SuggestedType = NAME_None 
) const
virtual

Parses AssetData to extract the primary type/name from it.

This works even if it isn't in the directory

◆ FindMissingChunkList()

virtual bool UAssetManager::FindMissingChunkList ( const TArray< FSoftObjectPath > &  AssetList,
TArray< int32 > &  OutMissingChunkList,
TArray< int32 > &  OutErrorChunkList 
) const
virtual

Returns the list of Chunks that are not currently mounted, and are required to load the referenced assets.

Returns true if any chunks are missing

参数
AssetListAsset Paths to check chunks for
OutMissingChunkListChunks that are known about but not yet installed
OutErrorChunkListChunks that do not exist at all and are not installable

◆ GetAssetDataForPath()

virtual bool UAssetManager::GetAssetDataForPath ( const FSoftObjectPath &  ObjectPath,
FAssetData &  AssetData 
) const
virtual

Gets the FAssetData at a specific path, handles redirectors and blueprint classes correctly.

Returns true if it found a valid data

◆ GetCachedPrimaryAssetEncryptionKeyGuid()

virtual void UAssetManager::GetCachedPrimaryAssetEncryptionKeyGuid ( FPrimaryAssetId  InPrimaryAssetId,
FGuid &  OutGuid 
)
virtual

Get the encryption key guid attached to this primary asset.

Can be invalid if the asset is not encrypted

◆ GetPackageManagers()

virtual bool UAssetManager::GetPackageManagers ( FName  PackageName,
bool  bRecurseToParents,
TSet< FPrimaryAssetId > &  ManagerSet 
) const
virtual

Returns list of PrimaryAssetIds that manage a package.

Will optionally recurse up the management chain

◆ GetPrimaryAssetData()

virtual bool UAssetManager::GetPrimaryAssetData ( const FPrimaryAssetId &  PrimaryAssetId,
FAssetData &  AssetData 
) const
virtual

Gets the FAssetData for a primary asset with the specified type/name, will only work for once that have been scanned for already.

Returns true if it found a valid data

◆ GetPrimaryAssetHandle()

TSharedPtr< FStreamableHandle > UAssetManager::GetPrimaryAssetHandle ( const FPrimaryAssetId &  PrimaryAssetId,
bool  bForceCurrent = false,
TArray< FName > *  Bundles = nullptr 
) const

Returns the loading handle associated with the primary asset, it can then be checked for progress or waited on

参数
PrimaryAssetIdAsset to get handle for
bForceCurrentIf true, returns the current handle. If false, will return pending if active, or current if not
BundlesIf not null, will fill in with a list of the requested bundle state
返回
Streamable Handle that can be used to poll or wait

◆ GetPrimaryAssetIdForObject()

virtual FPrimaryAssetId UAssetManager::GetPrimaryAssetIdForObject ( UObject *  Object) const
virtual

Sees if the passed in object is a registered primary asset, if so return it.

Returns invalid Identifier if not found

◆ GetPrimaryAssetIdForPath()

virtual FPrimaryAssetId UAssetManager::GetPrimaryAssetIdForPath ( const FSoftObjectPath &  ObjectPath) const
virtual

Sees if the passed in object path is a registered primary asset, if so return it.

Returns invalid Identifier if not found

◆ GetPrimaryAssetLoadSet()

bool UAssetManager::GetPrimaryAssetLoadSet ( TSet< FSoftObjectPath > &  OutAssetLoadSet,
const FPrimaryAssetId &  PrimaryAssetId,
const TArray< FName > &  LoadBundles,
bool  bLoadRecursive 
) const

Fills in a set of object paths with the assets that need to be loaded, for a given Primary Asset and bundle list

参数
OutAssetLoadSetSet that will have asset paths added to it
PrimaryAssetIdAsset that would be loaded
LoadBundlesList of bundles to load for those assets
bLoadRecursiveIf true, this will call RecursivelyExpandBundleData and recurse into sub bundles of other primary assets loaded by a bundle reference
返回
True if primary asset id was found

◆ GetPrimaryAssetObject()

virtual UObject * UAssetManager::GetPrimaryAssetObject ( const FPrimaryAssetId &  PrimaryAssetId) const
virtual

Gets the in-memory UObject for a primary asset id, returning nullptr if it's not in memory.

Will return blueprint class for blueprint assets. This works even if the asset wasn't loaded explicitly

◆ GetPrimaryAssetObjectList()

virtual bool UAssetManager::GetPrimaryAssetObjectList ( FPrimaryAssetType  PrimaryAssetType,
TArray< UObject * > &  ObjectList 
) const
virtual

Gets list of all loaded objects for a primary asset type, returns true if any were found.

Will return blueprint class for blueprint assets. This works even if the asset wasn't loaded explicitly

◆ GetPrimaryAssetsWithBundleState()

bool UAssetManager::GetPrimaryAssetsWithBundleState ( TArray< FPrimaryAssetId > &  PrimaryAssetList,
const TArray< FPrimaryAssetType > &  ValidTypes,
const TArray< FName > &  RequiredBundles,
const TArray< FName > &  ExcludedBundles = TArray< FName >(),
bool  bForceCurrent = false 
) const

Returns a list of primary assets that are in the given bundle state.

Only assets that are loaded or being loaded are valid

参数
PrimaryAssetListAny valid assets are added to this list
ValidTypesList of types that are allowed. If empty, all types allowed
RequiredBundlesAdds to list if the bundle state has all of these bundles. If empty will return all loaded
ExcludedBundlesDoesn't add if the bundle state has any of these bundles
bForceCurrentIf true, only use the current state. If false, use the current or pending
返回
True if any found

◆ GetRedirectedAssetPath()

virtual FName UAssetManager::GetRedirectedAssetPath ( FName  OldPath) const
virtual

Reads AssetManagerSettings for specifically redirected asset paths.

This is useful if you need to convert older saved data

◆ GetResourceAcquireProgress()

virtual bool UAssetManager::GetResourceAcquireProgress ( int32 &  OutAcquiredCount,
int32 &  OutRequestedCount 
) const
virtual

Returns the chunk download/install progress.

AcquiredCount is the number of chunks that were requested and have already been insatlled, Requested includes both installed and pending

◆ GetStreamableManager()

static FStreamableManager & UAssetManager::GetStreamableManager ( )
inlinestatic

Accesses the StreamableManager used by this Asset Manager.

Static for easy access

◆ GetTimerManager()

class FTimerManager * UAssetManager::GetTimerManager ( ) const

Returns a timer manager that is safe to use for asset loading actions.

This will either be the editor or game instance one, or null during very early startup

◆ IsAssetDataBlueprintOfClassSet()

virtual bool UAssetManager::IsAssetDataBlueprintOfClassSet ( const FAssetData &  AssetData,
const TSet< FName > &  ClassNameSet 
)
virtual

Checks to see if the given asset data is a blueprint with a base class in the ClassNameSet.

This checks the parent asset tag

◆ LoadAssetList()

virtual TSharedPtr< FStreamableHandle > UAssetManager::LoadAssetList ( const TArray< FSoftObjectPath > &  AssetList,
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = FStreamableManager::DefaultAsyncLoadPriority,
const FString &  DebugName = TEXT("LoadAssetList") 
)
virtual

Quick wrapper to async load some non primary assets with the primary streamable manager.

This will not auto release the handle, release it if needed

◆ LoadPrimaryAssets()

virtual TSharedPtr< FStreamableHandle > UAssetManager::LoadPrimaryAssets ( const TArray< FPrimaryAssetId > &  AssetsToLoad,
const TArray< FName > &  LoadBundles = TArray< FName >(),
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = FStreamableManager::DefaultAsyncLoadPriority 
)
virtual

Loads a list of Primary Assets.

This will start an async load of those assets, calling callback on completion. These assets will stay in memory until explicitly unloaded. You can wait on the returned streamable request or poll as needed. If there is no work to do, returned handle will be null and delegate will get called before function returns.

参数
AssetsToLoadList of primary assets to load
LoadBundlesList of bundles to load for those assets
DelegateToCallDelegate that will be called on completion, may be called before function returns if assets are already loaded
PriorityAsync loading priority for this request
返回
Streamable Handle that can be used to poll or wait. You do not need to keep this handle to stop the assets from being unloaded

◆ OnAssetRegistryAvailableAfterInitialization()

bool UAssetManager::OnAssetRegistryAvailableAfterInitialization ( FName  InName,
FAssetRegistryState &  OutNewState 
)
protected

Called when a new asset registry becomes available

参数
InNameLogical name for this asset registry. Must match the name give by
返回
TRUE if new data was loaded and added into the master asset registry

◆ PostInitProperties()

virtual void UAssetManager::PostInitProperties ( )
overridevirtual

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

This is called before any serialization or other setup has happened.

重载 UObject .

◆ PreloadPrimaryAssets()

virtual TSharedPtr< FStreamableHandle > UAssetManager::PreloadPrimaryAssets ( const TArray< FPrimaryAssetId > &  AssetsToLoad,
const TArray< FName > &  LoadBundles,
bool  bLoadRecursive,
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = FStreamableManager::DefaultAsyncLoadPriority 
)
virtual

Preloads data for a set of assets in a specific bundle state, and returns a handle you must keep active.

These assets are not officially Loaded, so Unload/ChangeBundleState will not affect them and if you release the handle without otherwise loading the assets they will be freed.

参数
AssetsToLoadList of primary assets to load
LoadBundlesList of bundles to load for those assets
bLoadRecursiveIf true, this will call RecursivelyExpandBundleData and recurse into sub bundles of other primary assets loaded by a bundle reference
DelegateToCallDelegate that will be called on completion, may be called before function returns if assets are already loaded
PriorityAsync loading priority for this request
返回
Streamable Handle that must be stored to keep the preloaded assets from being freed

◆ RecursivelyExpandBundleData()

virtual void UAssetManager::RecursivelyExpandBundleData ( FAssetBundleData &  BundleData) const
virtual

This will expand out references in the passed in AssetBundleData that are pointing to other primary assets with bundles.

This is useful to preload entire webs of assets

◆ ScanPathsForPrimaryAssets()

virtual int32 UAssetManager::ScanPathsForPrimaryAssets ( FPrimaryAssetType  PrimaryAssetType,
const TArray< FString > &  Paths,
UClass *  BaseClass,
bool  bHasBlueprintClasses,
bool  bIsEditorOnly = false,
bool  bForceSynchronousScan = true 
)
virtual

Scans a list of paths and reads asset data for all primary assets of a specific type.

If done in the editor it will load the data off disk, in cooked games it will load out of the asset registry cache

参数
PrimaryAssetTypeType of asset to look for. If the scanned asset matches GetPrimaryAssetType with this it will be added to directory
PathsList of file system paths to scan
BaseClassBase class of all loaded assets, if the scanned asset isn't a child of this class it will be skipped
bHasBlueprintClassesIf true, the assets are blueprints that subclass BaseClass. If false they are base UObject assets
bIsEditorOnlyIf true, assets will only be scanned in editor builds, and will not be stored into the asset registry
bForceSynchronousScanIf true will scan the disk synchronously, otherwise will wait for asset registry scan to complete
返回
Number of primary assets found

◆ SetPrimaryAssetRules()

virtual void UAssetManager::SetPrimaryAssetRules ( FPrimaryAssetId  PrimaryAssetId,
const FPrimaryAssetRules &  Rules 
)
virtual

Changes the management rules for a specific asset, this overrides the type rules.

If passed in Rules is default, delete override

◆ ShouldScanPrimaryAssetType()

virtual bool UAssetManager::ShouldScanPrimaryAssetType ( FPrimaryAssetTypeInfo &  TypeInfo) const
protectedvirtual

Returns true if the specified TypeInfo should be scanned.

Can be implemented by the game.

◆ StartBulkScanning()

virtual void UAssetManager::StartBulkScanning ( )
virtual

Call this before many calls to ScanPaths to improve load performance.

It will defer expensive updates until StopBulkScanning is called

◆ UnloadPrimaryAssets()

virtual int32 UAssetManager::UnloadPrimaryAssets ( const TArray< FPrimaryAssetId > &  AssetsToUnload)
virtual

Unloads a list of Primary Assets that were previously Loaded.

If the only thing keeping these assets in memory was a prior Load call, they will be freed.

参数
AssetsToUnloadList of primary assets to load
返回
Number of assets unloaded

类成员变量说明

◆ bShouldGuessTypeAndName

bool UAssetManager::bShouldGuessTypeAndName
protected

True if PrimaryAssetType/Name will be implied for loading assets that don't have it saved on disk.

Won't work for all projects

◆ ObjectReferenceList

TArray<UObject*> UAssetManager::ObjectReferenceList
protected

List of UObjects that are being kept from being GCd, derived from the asset type map.

Arrays are currently more efficient than Sets


该类的文档由以下文件生成: