PAK files are just virtual file system structures. When you mount a PAK file, the engine knows to search it’s directory structure when loading assets. UOnlineHotfixManager::HotfixPakFile() does this to patch in a new PAK file. Let’s assume the file was downloaded to c:\temp\NewContent.pak. To mount it, you’d do:
Then you can load the file as if it is in the content directory. You don’t need to use the FStreamableManager. That’s just a way to load assets off of disk in the background (Async Loading). You can load the object just using LoadObject() if you want a blocking load from disk. The streamable manager does not stream the file from some server out on the internet. It just background loads the file into memory from disk.
As for downloading the file from the net, I’d just use our http request/response system to pull data from your CDN for the given file.
hi after mounting pak file like that how can I access or load the assets. what is the path to that?
Is it FPaths::EngineContentDir() or FPaths::GameContentDir()?
Sorry, that should be Game/PathToAsset/AssetName for an asset that lives in the game content directory. For a content plugin it should be PluginName/PathToAsset/AssetName
I have the same question. I can load the assets only one way.
PakFile.SetMountPoint(FPaths::EngineContentDir());
… …
UObject* LoadObject = StreamableManager.SynchronousLoad(TEXT("/Engine/AssetName.AssetName"));
loadObject is the asset, but LoadErrors: ‘/Game/materialName.uasset’ reference from AssetName