better comments

This commit is contained in:
vis2k 2021-07-31 12:20:25 +08:00
parent 7071a6afc8
commit e951abeb34

View File

@ -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();