Skip to content

Commit

Permalink
fix(NetworkRoomManagerExt): Clear pool when returning to room scene
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGadget1024 committed Dec 29, 2024
1 parent bf66988 commit c4491c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ public override void OnRoomClientSceneChanged()
{
// Don't initialize the pool for host client because it's
// already initialized in OnRoomServerSceneChanged
if (!NetworkServer.active && networkSceneName == GameplayScene)
Spawner.InitializePool(rewardPrefab, 10);
if (NetworkServer.active) return;

if (networkSceneName == GameplayScene)
Spawner.InitializePool(rewardPrefab, poolSize);
else
Spawner.ClearPool();
}

/// <summary>
Expand Down

0 comments on commit c4491c7

Please sign in to comment.