在pak文件中,会挂接很多资源。api也在变化,
废话不多说,上代码
FPakPlatformFile* GetPakPlatformFile()
{
FPakPlatformFile* pakPlatformFile = nullptr;
auto platformFile = FPlatformFileManager::Get().FindPlatformFile(TEXT(“PakFile”));
if (platformFile)
{
pakPlatformFile = static_cast
}
else
{
pakPlatformFile = new FPakPlatformFile();
bool bInitialize = pakPlatformFile->Initialize(&FPlatformFileManager::Get().GetPlatformFile(), TEXT(“”));
if (bInitialize)
{
FPlatformFileManager::Get().SetPlatformFile(*pakPlatformFile);
}
}
return pakPlatformFile;
}
FPakFile pakFile(GetPakPlatformFile(), *pakFileName, false);
TArrray assetPathArray;
pakFile.FindPrunedFilesAtPath(assetPathArray, *pakFile.GetMountPoint(), true, false, true);
这样就可以获取挂载的资源名称数组assetPathArray了。