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
| 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.
| ChildHandles | List of handles to wrap into this one |
| DebugName | Name of this handle, will be reported in debug tools |
| 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.
| Target | Asset to get active handles for |
| HandleList | Fill in list of active handles |
| bOnlyManagedHandles | If true, only return handles that are managed by this manager, other active handles are skipped |
| 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.
| Target | Specific asset to load off disk |
| bManageActiveHandle | If true, the manager will keep the streamable handle active until explicitly released |
| RequestHandlePointer | If non-null, this will set the handle to the handle used to make this request. This useful for later releasing the handle |
| 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.
| TargetsToStream | Assets to load off disk |
| DelegateToCall | Delegate to call when load finishes. Will be called on the next tick if asset is already loaded, or many seconds later |
| Priority | Priority to pass to the streaming system, higher priority will be loaded first |
| bManageActiveHandle | If true, the manager will keep the streamable handle active until explicitly released |
| bStartStalled | If true, the handle will start in a stalled state and will not attempt to actually async load until StartStalledHandle is called on it |
| DebugName | Name of this handle, will be reported in debug tools |
| 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.
| 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.
| TargetsToStream | Assets to load off disk |
| bManageActiveHandle | If true, the manager will keep the streamable handle active until explicitly released |
| DebugName | Name of this handle, will be reported in debug tools |
| 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