From 10229f3b968398f51645ae2c5879aad273c0e164 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 16 Dec 2018 15:39:38 +0100 Subject: [PATCH] Remove ClearLocalObjects functions and use NetworkIdentity.spawned.Clear(); instead --- Mirror/Runtime/NetworkScene.cs | 9 ++------- Mirror/Runtime/NetworkServer.cs | 5 ----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Mirror/Runtime/NetworkScene.cs b/Mirror/Runtime/NetworkScene.cs index 66abd1da8..22c959543 100644 --- a/Mirror/Runtime/NetworkScene.cs +++ b/Mirror/Runtime/NetworkScene.cs @@ -14,7 +14,7 @@ internal class NetworkScene internal void Shutdown() { - ClearLocalObjects(); + NetworkIdentity.spawned.Clear(); ClearSpawners(); } @@ -66,11 +66,6 @@ internal bool RemoveLocalObject(uint netId) return NetworkIdentity.spawned.Remove(netId); } - internal void ClearLocalObjects() - { - NetworkIdentity.spawned.Clear(); - } - internal static void RegisterPrefab(GameObject prefab, Guid newAssetId) { NetworkIdentity view = prefab.GetComponent(); @@ -229,7 +224,7 @@ internal void DestroyAllClientObjects() } } } - ClearLocalObjects(); + NetworkIdentity.spawned.Clear(); } } } diff --git a/Mirror/Runtime/NetworkServer.cs b/Mirror/Runtime/NetworkServer.cs index c89561fca..4e91116f5 100644 --- a/Mirror/Runtime/NetworkServer.cs +++ b/Mirror/Runtime/NetworkServer.cs @@ -1069,11 +1069,6 @@ static void DestroyObject(NetworkIdentity uv, bool destroyServerObject) uv.MarkForReset(); } - public static void ClearLocalObjects() - { - NetworkIdentity.spawned.Clear(); - } - public static void Spawn(GameObject obj) { if (VerifyCanSpawn(obj))