From e951abeb3424becb7d1bee12f37bfd180578719c Mon Sep 17 00:00:00 2001 From: vis2k Date: Sat, 31 Jul 2021 12:20:25 +0800 Subject: [PATCH] better comments --- Assets/Mirror/Runtime/NetworkServer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index e82ffcc60..966740dd6 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -1231,14 +1231,13 @@ static void DestroyObject(NetworkIdentity identity, bool destroyServerObject) identity.OnStopServer(); - // when unspawning, don't destroy the server's object + // only .Destroy() if we are supposed to destroy it on server if (destroyServerObject) { identity.destroyCalled = true; UnityEngine.Object.Destroy(identity.gameObject); } - // if we are destroying the server object we don't need to reset the identity - // reseting it will cause isClient/isServer to be false in the OnDestroy call + // otherwise simply .Reset() it. else { identity.Reset();