diff --git a/Assets/Mirror/Runtime/ClientScene.cs b/Assets/Mirror/Runtime/ClientScene.cs index 141afa66b..9b6c52673 100644 --- a/Assets/Mirror/Runtime/ClientScene.cs +++ b/Assets/Mirror/Runtime/ClientScene.cs @@ -671,6 +671,8 @@ static bool InvokeUnSpawnHandler(Guid assetId, GameObject obj) /// Destroys all networked objects on the client. /// This can be used to clean up when a network connection is closed. /// + // + // Note: NetworkServer.CleanupNetworkIdentities does the same on server. public static void DestroyAllClientObjects() { // user can modify spawned lists which causes InvalidOperationException diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 01e22c546..6dad6df6f 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -132,6 +132,7 @@ public static void Shutdown() NetworkIdentity.ResetNextNetworkId(); } + // Note: ClientScene.DestroyAllClientObjects does the same on client. static void CleanupNetworkIdentities() { foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values)