DestroyAllClientObjects/CleanupNetworkIdentities: add comments

This commit is contained in:
vis2k 2021-03-07 11:51:26 +08:00
parent 4d971c1e57
commit 6447871d8f
2 changed files with 3 additions and 0 deletions

View File

@ -671,6 +671,8 @@ static bool InvokeUnSpawnHandler(Guid assetId, GameObject obj)
/// Destroys all networked objects on the client. /// Destroys all networked objects on the client.
/// <para>This can be used to clean up when a network connection is closed.</para> /// <para>This can be used to clean up when a network connection is closed.</para>
/// </summary> /// </summary>
//
// Note: NetworkServer.CleanupNetworkIdentities does the same on server.
public static void DestroyAllClientObjects() public static void DestroyAllClientObjects()
{ {
// user can modify spawned lists which causes InvalidOperationException // user can modify spawned lists which causes InvalidOperationException

View File

@ -132,6 +132,7 @@ public static void Shutdown()
NetworkIdentity.ResetNextNetworkId(); NetworkIdentity.ResetNextNetworkId();
} }
// Note: ClientScene.DestroyAllClientObjects does the same on client.
static void CleanupNetworkIdentities() static void CleanupNetworkIdentities()
{ {
foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values) foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values)