diff --git a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs index de2d275029..03bbf3eae0 100644 --- a/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs +++ b/com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs @@ -261,6 +261,12 @@ private void OnValidate() }; } + // If the scene is not dirty or the asset database is currently updating then we can skip updating the NetworkPrefab information + if (!activeScene.isDirty || UnityEditor.EditorApplication.isUpdating) + { + return; + } + // During OnValidate we will always clear out NetworkPrefabOverrideLinks and rebuild it NetworkConfig.NetworkPrefabOverrideLinks.Clear(); @@ -312,7 +318,7 @@ private void OnValidate() } } } - } + } } #endif