1、将场景打包为Pak并加载
1、参考这篇文章将场景打包为pak,UE4打包并加载Pak-Windows/iOS/Android不同平台Editor/Runtime不同运行模式兼容
2、在Mount Pak后直接打开Map即可
void UMapManager::OpenMap(FString Path)
{
UWorld* World = UGlobalManager::GetInstance()->GetMyWorld();
if (World && !Path.IsEmpty())
{
FString CurMap = GetCurMapPath();
if (!Path.Equals(CurMap))
{
UGameplayStatics::OpenLevel(World, FName(*Path));
}
}
}
FString UMapManager::GetCurMapPath()
{
FString MapName = UGameplayStatics::GetCurrentLevelName(UGlobalManager::GetInstance()->GetMyWorld(), true);
FString PathName = UGlobalManager::GetInstance()->GetMyWorld()->GetCurrentLevel()->GetPathN