From ead0d351c95c831be47fa989e20ab8b2edf64ab7 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 7 Mar 2021 18:10:51 +0800 Subject: [PATCH] cleanup --- Assets/Mirror/Runtime/ClientScene.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Mirror/Runtime/ClientScene.cs b/Assets/Mirror/Runtime/ClientScene.cs index 7dc6a0fbe..bd07de9b2 100644 --- a/Assets/Mirror/Runtime/ClientScene.cs +++ b/Assets/Mirror/Runtime/ClientScene.cs @@ -855,15 +855,14 @@ static void DestroyObject(uint netId) internal static void OnHostClientObjectDestroy(ObjectDestroyMessage msg) { // Debug.Log("ClientScene.OnLocalObjectObjDestroy netId:" + msg.netId); - NetworkIdentity.spawned.Remove(msg.netId); } internal static void OnHostClientObjectHide(ObjectHideMessage msg) { // Debug.Log("ClientScene::OnLocalObjectObjHide netId:" + msg.netId); - - if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && localObject != null) + if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && + localObject != null) { localObject.OnSetHostVisibility(false); } @@ -871,7 +870,8 @@ internal static void OnHostClientObjectHide(ObjectHideMessage msg) internal static void OnHostClientSpawn(SpawnMessage msg) { - if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && localObject != null) + if (NetworkIdentity.spawned.TryGetValue(msg.netId, out NetworkIdentity localObject) && + localObject != null) { if (msg.isLocalPlayer) InternalAddPlayer(localObject);