From 163600c49837c9a15fdf39eb3cb512b55ff798e4 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 30 Dec 2018 15:29:45 +0100 Subject: [PATCH] NetworkScenePostProcess: removed prefabWarnings HashSet because the extra code is not worth the rare case where we have more than one NetworkIdentity on a prefab. There is no harm in showing a warning for each one. --- Mirror/Editor/NetworkScenePostProcess.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Mirror/Editor/NetworkScenePostProcess.cs b/Mirror/Editor/NetworkScenePostProcess.cs index 2f7cc2a81..b8ca5c0d9 100644 --- a/Mirror/Editor/NetworkScenePostProcess.cs +++ b/Mirror/Editor/NetworkScenePostProcess.cs @@ -84,8 +84,6 @@ public static int CompareNetworkIdentitySiblingPaths(NetworkIdentity left, Netwo [PostProcessScene] public static void OnPostProcessScene() { - var prefabWarnings = new HashSet(); - // vis2k: MISMATCHING SCENEID BUG FIX // problem: // * FindObjectsOfType order is not guaranteed. restarting the @@ -158,12 +156,8 @@ public static void OnPostProcessScene() GameObject prefabRootGO = PrefabUtility.FindPrefabRoot(prefabGO); if (prefabRootGO) { - NetworkIdentity[] identities = prefabRootGO.GetComponentsInChildren(); - if (identities.Length > 1 && !prefabWarnings.Contains(prefabRootGO.name)) + if (prefabRootGO.GetComponentsInChildren().Length > 1) { - // make sure we only print one error per prefab - prefabWarnings.Add(prefabRootGO.name); - Debug.LogWarningFormat("Prefab '{0}' has several NetworkIdentity components attached to itself or its children, this is not supported.", prefabRootGO.name); } }