mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
better comments
This commit is contained in:
parent
7071a6afc8
commit
e951abeb34
@ -1231,14 +1231,13 @@ static void DestroyObject(NetworkIdentity identity, bool destroyServerObject)
|
|||||||
|
|
||||||
identity.OnStopServer();
|
identity.OnStopServer();
|
||||||
|
|
||||||
// when unspawning, don't destroy the server's object
|
// only .Destroy() if we are supposed to destroy it on server
|
||||||
if (destroyServerObject)
|
if (destroyServerObject)
|
||||||
{
|
{
|
||||||
identity.destroyCalled = true;
|
identity.destroyCalled = true;
|
||||||
UnityEngine.Object.Destroy(identity.gameObject);
|
UnityEngine.Object.Destroy(identity.gameObject);
|
||||||
}
|
}
|
||||||
// if we are destroying the server object we don't need to reset the identity
|
// otherwise simply .Reset() it.
|
||||||
// reseting it will cause isClient/isServer to be false in the OnDestroy call
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
identity.Reset();
|
identity.Reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user