From 36ba1f17911eb1f6e6ed6c3e3946288dd9475107 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 23 Aug 2024 17:59:52 -0500 Subject: [PATCH 1/3] fix Backport fix of #3026 --- .../Editor/NetworkManagerHelper.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/com.unity.netcode.gameobjects/Editor/NetworkManagerHelper.cs b/com.unity.netcode.gameobjects/Editor/NetworkManagerHelper.cs index 19643d40bd..3138369d57 100644 --- a/com.unity.netcode.gameobjects/Editor/NetworkManagerHelper.cs +++ b/com.unity.netcode.gameobjects/Editor/NetworkManagerHelper.cs @@ -61,6 +61,12 @@ private static void EditorApplication_playModeStateChanged(PlayModeStateChange p { s_LastKnownNetworkManagerParents.Clear(); ScenesInBuildActiveSceneCheck(); + EditorApplication.hierarchyChanged -= EditorApplication_hierarchyChanged; + break; + } + case PlayModeStateChange.EnteredEditMode: + { + EditorApplication.hierarchyChanged += EditorApplication_hierarchyChanged; break; } } @@ -110,6 +116,12 @@ private static void ScenesInBuildActiveSceneCheck() /// private static void EditorApplication_hierarchyChanged() { + if (Application.isPlaying) + { + EditorApplication.hierarchyChanged -= EditorApplication_hierarchyChanged; + return; + } + var allNetworkManagers = Resources.FindObjectsOfTypeAll(); foreach (var networkManager in allNetworkManagers) { From cf4ae0497515e17bf14229c3d870560005750028 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 23 Aug 2024 18:00:04 -0500 Subject: [PATCH 2/3] update adding changelog entry --- com.unity.netcode.gameobjects/CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 3c72add8fc..7b095e1b1b 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com). [Unreleased] + +### Added + +### Fixed + +- Fixed issue where the `NetworkManagerHelper` was continuing to check for hierarchy changes when in play mode. + +### Changed + + +## [1.11.0] - 2024-08-20 + ### Added - Added `NetworkVariable.CheckDirtyState` that is to be used in tandem with collections in order to detect whether the collection or an item within the collection has changed. (#3005) From 6292e9c91ec453ddf9524e66b8de1c8b39139826 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Fri, 23 Aug 2024 18:02:20 -0500 Subject: [PATCH 3/3] update adding PR number to changelog entry --- com.unity.netcode.gameobjects/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 7b095e1b1b..a6a35dd804 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -11,7 +11,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed -- Fixed issue where the `NetworkManagerHelper` was continuing to check for hierarchy changes when in play mode. +- Fixed issue where the `NetworkManagerHelper` was continuing to check for hierarchy changes when in play mode. (#3027) ### Changed