map unload fix when changing scenes
This commit is contained in:
@@ -423,16 +423,8 @@ namespace Game
|
||||
|
||||
private void UnloadMap()
|
||||
{
|
||||
IEnumerable<Actor> GetChildrenRecursive(Actor actor)
|
||||
{
|
||||
foreach (var act in actor.GetChildren<Actor>())
|
||||
{
|
||||
yield return act;
|
||||
|
||||
foreach (var child in GetChildrenRecursive(act))
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
if (!worldSpawnActor)
|
||||
return;
|
||||
|
||||
var virtualAssets = new List<BinaryAsset>();
|
||||
var allActors = GetChildrenRecursive(worldSpawnActor).ToList();
|
||||
@@ -450,6 +442,17 @@ namespace Game
|
||||
#if FLAX_EDITOR
|
||||
Level.SceneUnloading -= OnSceneUnloading;
|
||||
#endif
|
||||
|
||||
IEnumerable<Actor> GetChildrenRecursive(Actor actor)
|
||||
{
|
||||
foreach (var act in actor.GetChildren<Actor>())
|
||||
{
|
||||
yield return act;
|
||||
|
||||
foreach (var child in GetChildrenRecursive(act))
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadMap(bool forceLoad)
|
||||
|
||||
Reference in New Issue
Block a user