18 static void Initialize();
19 static void Destroy();
21 FORCEINLINE
static bool IsAssetHandleValid(
const FAssetHandle Handle)
23 return LProject::GetAssetManager()->IsAssetHandleValid(Handle);
28 return LProject::GetAssetManager()->GetAssetType(Handle);
31 FORCEINLINE
static bool ReloadData(
const FAssetHandle Handle)
33 return LProject::GetAssetManager()->ReloadData(Handle);
44 static std::unordered_set<FAssetHandle> GetAllAssetsWithType()
46 return LProject::GetAssetManager()->GetAllAssetsWithType(T::GetStaticType());
49 FORCEINLINE
static const std::unordered_map<FAssetHandle, TObjectPtr<LAsset>>& GetLoadedAssets()
51 return LProject::GetAssetManager()->GetLoadedAssets();
54 FORCEINLINE
static const std::unordered_map<FAssetHandle , TObjectPtr<LAsset>>& GetMemoryOnlyAssets()
56 return LProject::GetAssetManager()->GetMemoryOnlyAssets();
59 FORCEINLINE
static FAssetHandle GetAssetHandleFromFilePath(
const std::filesystem::path& InFilepath)
61 return LProject::GetAssetManager()->GetAssetHandleFromFilePath(InFilepath);
64 template<
typename TAsset,
typename... TArgs>
65 static FAssetHandle CreateMemoryOnlyAsset(TArgs&&... Args)
67 static_assert(std::is_base_of_v<LAsset, TAsset>,
"CreateMemoryOnlyAsset only works for types derived from Asset");
70 LProject::GetAssetManager()->AddMemoryOnlyAsset(Asset);
75 template<
typename TAsset,
typename... TArgs>
76 static FAssetHandle CreateMemoryOnlyRendererAsset(TArgs&&... Args)
78 static_assert(std::is_base_of_v<LAsset, TAsset>,
"CreateMemoryOnlyAsset only works for types derived from Asset");
81 LProject::GetAssetManager()->AddMemoryOnlyAsset(Asset);
86 template<
typename TAsset,
typename... TArgs>
89 static_assert(std::is_base_of_v<LAsset, TAsset>,
"CreateMemoryOnlyAsset only works for types derived from Asset");
91 Asset->Handle = Handle;
92 LProject::GetAssetManager()->AddMemoryOnlyAsset(Asset);
97 template<
typename TAsset>
100 static_assert(std::is_base_of_v<LAsset, TAsset>,
"AddMemoryOnlyAsset only works for types derived from Asset");
102 LProject::GetAssetManager()->AddMemoryOnlyAsset(Asset);
104 return Asset->Handle;
107 FORCEINLINE
static bool IsMemoryAsset(
const FAssetHandle Handle)
109 return LProject::GetAssetManager()->IsMemoryAsset(Handle);