WorldPartition地图中编辑LevelInstance退出后LevelInstance的actor不一定会被重新刷新到WP的问题

<br>您好,还是Jira UE-257047那个问题。在WorldPartition地图中编辑LevelInstance退出后LevelInstance的actor不一定会被重新刷新到WP的问题。

我研究发现,出现此问题的大体原因还是WorldParititon中的ActorDesc合集没有正确刷新。

因为我方工程进度较紧急,所以我实现了一个临时的解决方案。经测试似乎有效。

请协助评估一下此方法是否可行。

具体操作是在ULevelInstanceSubsystem::CommitLevelInstanceInternal​函数的最后方,强制清空WP数据,并重新初始化WP。代码如下:

UWorld* world = GetWorld();

if(world)

{

auto *wp=world->GetWorldPartition();

if(wp)

{

const FTransform \&wp\_transfom\=wp\-\>GetInstanceTransform();



wp\-\>Uninitialize();

wp\-\>Empty();

FWorldPartitionHelpers::DoCollectGarbage();

wp\-\>Initialize(world,wp\_transfom);

}

}

好的,感谢反馈,我会把这个信息补充到内部的Jira里,目前开发团队还有些新功能需要开发所以这个jira优先级不是很高,后面有新的消息我在跟您同步