I have packed a file MyModel.uasset into a PAK file MyAsset.pak with UnrealPak.exe. I then put MyAsset.pak under WindowsNoEditor\Engine\Content, which is created by building a development package of my game. I then tried to use the following code to load that pak file at runtime. The following code comes from this question:
if (FCoreDelegates::OnMountPak.IsBound()) // returns true
{
const FString PakFilPath = "../../../Engine/Content/MyAsset.pak";
FCoreDelegates::OnMountPak.Execute(PakFilPath, 0) // returns true
UStaticMesh *LoadedMesh = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("../../../Engine/Content/MyAsset/MyModel.uasset")));
if (LoadedMesh)
{
OurVisibleComponent->SetStaticMesh(LoadedMesh);
}
}
I have chcked that the statement FCoreDelegates::OnMountPak.Execute(PakFilPath, 0) returns true; but after that how can I get the MyModel.uasset out of the PAK file? How should I specify the path to StaticLoadObject?