50 virtual void Initialize(FSubsystemCollectionBase& Collection)
override;
53 virtual void Deinitialize()
override;
62 void RequestLoad(FGameplayTag BundleTag, TFunction<
void()> OnReady =
nullptr);
72 void RequestLoad(
const TArray<FGameplayTag>& BundleTags, TFunction<
void()> OnAllReady);
79 UFUNCTION(BlueprintCallable, Category =
"Bundle")
80 void Release(FGameplayTag BundleTag);
87 UFUNCTION(BlueprintCallable, Category =
"Bundle")
88 void ForceRelease(FGameplayTag BundleTag);
96 UFUNCTION(BlueprintCallable, Category =
"Bundle")
105 UFUNCTION(BlueprintCallable, Category =
"Bundle")
106 bool IsLoaded(FGameplayTag BundleTag)
const;
113 UFUNCTION(BlueprintCallable, Category =
"Bundle")
114 TArray<FGameplayTag> GetLoadedBundles()
const;
123 void ReleaseUnusedBundles(
const TArray<FGameplayTag>& RequiredTags);
136 template <
typename T>
137 T* GetBundleAsset(FGameplayTag BundleTag,
const TSoftObjectPtr<T>& AssetPtr)
const;
149 template <
typename T>
150 void RequestBundleAsset(FGameplayTag BundleTag,
const TSoftObjectPtr<T>& AssetPtr, TFunction<
void(T*)> OnReady);
154 void ScanAndRegisterBundles();
157 void PreLoadBundles();
164 void OnAllDependenciesReady(FGameplayTag BundleTag);
173 void OnAssetsLoaded(FGameplayTag BundleTag);
180 void FlushPendingCallbacks(FGameplayTag BundleTag);
182 void NotifyBundleLoadedToAssets(
const TArray<UObject*>& Assets, FGameplayTag BundleTag);
183 void NotifyBundleReleasedToAssets(
const TArray<UObject*>& Assets, FGameplayTag BundleTag);
237 TSoftObjectPtr<T> AssetCapture = AssetPtr;
239 RequestLoad(BundleTag, [
this, BundleTag, AssetCapture, OnReady = MoveTemp(OnReady)]()
241 T* Asset = AssetCapture.Get();
243 if (Asset ==
nullptr)
245 LOG_WARNING(LogCKAsset,
"RequestBundleAsset: 번들 '%s' 로드 완료 후에도 에셋을 찾을 수 없습니다: %s", *BundleTag.ToString(), *AssetCapture.ToString());
void RequestLoad(FGameplayTag BundleTag, TFunction< void()> OnReady=nullptr)
번들을 비동기 로드합니다. 로드 완료 시 OnReady 콜백을 호출합니다.
Definition DataBundleRegistry.cpp:141
T * GetBundleAsset(FGameplayTag BundleTag, const TSoftObjectPtr< T > &AssetPtr) const
로드된 번들에서 특정 에셋을 동기적으로 반환합니다.
Definition DataBundleRegistry.h:215
void RequestBundleAsset(FGameplayTag BundleTag, const TSoftObjectPtr< T > &AssetPtr, TFunction< void(T *)> OnReady)
번들을 비동기 로드한 뒤 에셋 포인터를 콜백으로 전달합니다.
Definition DataBundleRegistry.h:235
번들 하나의 런타임 상태를 담는 구조체.
Definition DataBundleRegistry.h:192
TSharedPtr< FStreamableHandle > Handle
에셋 스트리밍 핸들. 언로드 시 명시적으로 해제됩니다.
Definition DataBundleRegistry.h:194
TArray< TFunction< void()> > PendingCallbacks
로드 완료 시 일괄 실행할 콜백 목록.
Definition DataBundleRegistry.h:200