NetworkServer.CleanupNetworkIdentities: add comments

This commit is contained in:
vis2k 2021-03-07 11:41:43 +08:00
parent 11718d9521
commit 4d971c1e57

View File

@ -138,11 +138,14 @@ static void CleanupNetworkIdentities()
{
if (identity != null)
{
// scene objects are reset and disabled.
// they always stay in the scene, we don't destroy them.
if (identity.sceneId != 0)
{
identity.Reset();
identity.gameObject.SetActive(false);
}
// spawned objects are destroyed
else
{
GameObject.Destroy(identity.gameObject);