-
Notifications
You must be signed in to change notification settings - Fork 465
Description
There is a script in Netcode that makes my project lag a lot when playing from the Editor.
It's an editor script that just send some kind of Warning but it makes the whole game lag.
I did a post with more details here:
https://discussions.unity.com/t/performance-spike-because-of-a-netcode-networkmanagerhelper-editor-script-any-way-to-disable-that/1505627
But basically it's its NetworkManagerHelper.cs this function
private static void EditorApplication_hierarchyChanged()
{
var allNetworkManagers = Resources.FindObjectsOfTypeAll<NetworkManager>();
foreach (var networkManager in allNetworkManagers)
{
if (!networkManager.NetworkManagerCheckForParent())
{
Singleton.CheckAndNotifyUserNetworkObjectRemoved(networkManager);
}
}
}
I have a large scene with a lot of gameobjects, most have their scripts/components disabled so the performances are very good in the build. It's just that this function makes the game unplayable from the editor.
Maybe just add this at the start of the function?
if(Application.isPlaying)
return;
I could edit it myself, its just that this requires copying netcode script in the project instead of using the package manager, and makes updating version more complex.