Skip to content

Commit

Permalink
MultiSceneNetManager: style / syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGadget1024 committed Dec 22, 2024
1 parent d135910 commit 79ebd29
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ IEnumerator ServerLoadSubScenes()
}

Spawner.InitializePool(rewardPrefab, poolSize);
for (int index = 0; index < subScenes.Count; index++)
if (subScenes[index].IsValid())
Spawner.InitialSpawn(subScenes[index]);

foreach (Scene scene in subScenes)
if (scene.IsValid())
Spawner.InitialSpawn(scene);

subscenesLoaded = true;
}
Expand All @@ -118,7 +119,10 @@ IEnumerator ServerLoadSubScenes()
public override void OnStopServer()
{
NetworkServer.SendToAll(new SceneMessage { sceneName = gameScene, sceneOperation = SceneOperation.UnloadAdditive });
if (gameObject.activeSelf) StartCoroutine(ServerUnloadSubScenes());

if (gameObject.activeSelf)
StartCoroutine(ServerUnloadSubScenes());

Spawner.ClearPool();
clientIndex = 0;
}
Expand Down

0 comments on commit 79ebd29

Please sign in to comment.