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

A native class for managing streaming assets in and keeping them in memory. 更多...

#include <StreamableManager.h>

+ 类 FStreamableManager 继承关系图:

Public 成员函数

virtual void AddReferencedObjects (FReferenceCollector &Collector) override
 Add referenced objects to stop them from GCing
 
TSharedPtr< FStreamableHandle > CreateCombinedHandle (const TArray< TSharedPtr< FStreamableHandle > > &ChildHandles, const FString &DebugName=TEXT("CreateCombinedHandle"))
 Creates a combined handle, which will wait for other handles to complete before completing. 更多...
 
 FStreamableManager (const FStreamableManager &)=delete
 Not safe to copy or duplicate
 
bool GetActiveHandles (const FSoftObjectPath &Target, TArray< TSharedRef< FStreamableHandle > > &HandleList, bool bOnlyManagedHandles=false) const
 Gets list of handles that are directly referencing this asset, returns true if any found. 更多...
 
const FString & GetManagerName () const
 Returns the debug name for this manager
 
virtual FString GetReferencerName () const override
 Use this method to report a name for your referencer.
 
virtual bool GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const override
 Use this method to report how the specified object is referenced, if necessary
 
bool IsAsyncLoadComplete (const FSoftObjectPath &Target) const
 Returns true if all pending async loads have finished for this target
 
UObject * LoadSynchronous (const FSoftObjectPath &Target, bool bManageActiveHandle=false, TSharedPtr< FStreamableHandle > *RequestHandlePointer=nullptr)
 Synchronously load the referred asset and return the loaded object, or nullptr if it can't be found. 更多...
 
template<typename T >
T * LoadSynchronous (const FSoftObjectPath &Target, bool bManageActiveHandle=false, TSharedPtr< FStreamableHandle > *RequestHandlePointer=nullptr)
 Typed wrappers
 
TSharedPtr< FStreamableHandle > RequestAsyncLoad (TArray< FSoftObjectPath > TargetsToStream, FStreamableDelegate DelegateToCall=FStreamableDelegate(), TAsyncLoadPriority Priority=DefaultAsyncLoadPriority, bool bManageActiveHandle=false, bool bStartStalled=false, FString DebugName=TEXT("RequestAsyncLoad ArrayDelegate"))
 This is the primary streamable operation. 更多...
 
TSharedPtr< FStreamableHandle > RequestAsyncLoad (TArray< FSoftObjectPath > TargetsToStream, TFunction< void()> &&Callback, TAsyncLoadPriority Priority=DefaultAsyncLoadPriority, bool bManageActiveHandle=false, bool bStartStalled=false, FString DebugName=TEXT("RequestAsyncLoad ArrayLambda"))
 Lambda Wrappers. 更多...
 
TSharedPtr< FStreamableHandle > RequestSyncLoad (TArray< FSoftObjectPath > TargetsToStream, bool bManageActiveHandle=false, FString DebugName=TEXT("RequestSyncLoad Array"))
 Synchronously load a set of assets, and return a handle. 更多...
 
FSoftObjectPath ResolveRedirects (const FSoftObjectPath &Target) const
 Checks for any redirectors that were previously loaded, and returns the redirected target if found. 更多...
 
void SetManagerName (FString InName)
 Modifies the debug name of this manager, used for debugging GC references
 
void Unload (const FSoftObjectPath &Target)
 This will release any managed active handles pointing to the target soft object path, even if they include other requested assets in the same load
 
- Public 成员函数 继承自 FGCObject
virtual void AddReferencedObjects (FReferenceCollector &Collector)=0
 Pure virtual that must be overloaded by the inheriting class. 更多...
 
 FGCObject (FGCObject &&)
 Move constructor
 
 FGCObject (FGCObject const &)
 Copy constructor
 
 FGCObject (void)
 Tells the global object that forwards AddReferencedObjects calls on to objects that a new object is requiring AddReferencedObjects call.
 
virtual FString GetReferencerName () const
 Use this method to report a name for your referencer.
 
virtual bool GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const
 Use this method to report how the specified object is referenced, if necessary
 
virtual ~FGCObject (void)
 Removes this instance from the global referencer's list
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 FGCObject
static void StaticInit (void)
 Initializes the global object referencer and adds it to the root set.
 
- 静态 Public 属性 继承自 FGCObject
static UGCObjectReferencer * GGCObjectReferencer
 The static object referencer object that is shared across all garbage collectible non-UObject objects.
 

详细描述

A native class for managing streaming assets in and keeping them in memory.

AssetManager is the global singleton version of this with blueprint access

成员函数说明

◆ CreateCombinedHandle()

TSharedPtr< FStreamableHandle > FStreamableManager::CreateCombinedHandle ( const TArray< TSharedPtr< FStreamableHandle > > &  ChildHandles,
const FString &  DebugName = TEXT("CreateCombinedHandle") 
)

Creates a combined handle, which will wait for other handles to complete before completing.

The child handles will be held as hard references as long as this handle is active.

参数
ChildHandlesList of handles to wrap into this one
DebugNameName of this handle, will be reported in debug tools

◆ GetActiveHandles()

bool FStreamableManager::GetActiveHandles ( const FSoftObjectPath &  Target,
TArray< TSharedRef< FStreamableHandle > > &  HandleList,
bool  bOnlyManagedHandles = false 
) const

Gets list of handles that are directly referencing this asset, returns true if any found.

Combined Handles will not be returned by this function.

参数
TargetAsset to get active handles for
HandleListFill in list of active handles
bOnlyManagedHandlesIf true, only return handles that are managed by this manager, other active handles are skipped

◆ LoadSynchronous()

UObject * FStreamableManager::LoadSynchronous ( const FSoftObjectPath &  Target,
bool  bManageActiveHandle = false,
TSharedPtr< FStreamableHandle > *  RequestHandlePointer = nullptr 
)

Synchronously load the referred asset and return the loaded object, or nullptr if it can't be found.

This can be very slow and may stall the game thread for several seconds.

参数
TargetSpecific asset to load off disk
bManageActiveHandleIf true, the manager will keep the streamable handle active until explicitly released
RequestHandlePointerIf non-null, this will set the handle to the handle used to make this request. This useful for later releasing the handle

◆ RequestAsyncLoad() [1/2]

TSharedPtr< FStreamableHandle > FStreamableManager::RequestAsyncLoad ( TArray< FSoftObjectPath >  TargetsToStream,
FStreamableDelegate  DelegateToCall = FStreamableDelegate(),
TAsyncLoadPriority  Priority = DefaultAsyncLoadPriority,
bool  bManageActiveHandle = false,
bool  bStartStalled = false,
FString  DebugName = TEXT("RequestAsyncLoad ArrayDelegate") 
)

This is the primary streamable operation.

Requests streaming of one or more target objects. When complete, a delegate function is called. Returns a Streamable Handle.

参数
TargetsToStreamAssets to load off disk
DelegateToCallDelegate to call when load finishes. Will be called on the next tick if asset is already loaded, or many seconds later
PriorityPriority to pass to the streaming system, higher priority will be loaded first
bManageActiveHandleIf true, the manager will keep the streamable handle active until explicitly released
bStartStalledIf true, the handle will start in a stalled state and will not attempt to actually async load until StartStalledHandle is called on it
DebugNameName of this handle, will be reported in debug tools

◆ RequestAsyncLoad() [2/2]

TSharedPtr< FStreamableHandle > FStreamableManager::RequestAsyncLoad ( TArray< FSoftObjectPath >  TargetsToStream,
TFunction< void()> &&  Callback,
TAsyncLoadPriority  Priority = DefaultAsyncLoadPriority,
bool  bManageActiveHandle = false,
bool  bStartStalled = false,
FString  DebugName = TEXT("RequestAsyncLoad ArrayLambda") 
)

Lambda Wrappers.

Be aware that Callback may go off multiple seconds in the future.

◆ RequestSyncLoad()

TSharedPtr< FStreamableHandle > FStreamableManager::RequestSyncLoad ( TArray< FSoftObjectPath >  TargetsToStream,
bool  bManageActiveHandle = false,
FString  DebugName = TEXT("RequestSyncLoad Array") 
)

Synchronously load a set of assets, and return a handle.

This can be very slow and may stall the game thread for several seconds.

参数
TargetsToStreamAssets to load off disk
bManageActiveHandleIf true, the manager will keep the streamable handle active until explicitly released
DebugNameName of this handle, will be reported in debug tools

◆ ResolveRedirects()

FSoftObjectPath FStreamableManager::ResolveRedirects ( const FSoftObjectPath &  Target) const

Checks for any redirectors that were previously loaded, and returns the redirected target if found.

This will not handle redirects that it doesn't yet know about


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