You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Endless warning dialogs when NetworkBehaviour is added to NetworkManager - MTT-3252 (#1947)
* fix
MTT-3252
This fixes the endless dialog loop issue.
* style
updating comments and the dialog text copy.
* Update CHANGELOG.md
Co-authored-by: Unity Netcode CI <[email protected]>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
7
Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com).
8
+
### Added
9
+
10
+
### Changed
11
+
12
+
### Removed
8
13
9
14
### Fixed
10
15
11
16
- Fixed: Hosting again after failing to host now works correctly
17
+
- Fixed endless dialog boxes when adding a NetworkBehaviour to a NetworkManager or vice-versa. (#1947)
12
18
13
19
- Fixed NetworkManager to cleanup connected client lists after stopping (#1945)
14
20
- Fixed: NetworkHide followed by NetworkShow on the same frame works correctly (#1940)
if(EditorUtility.DisplayDialog("NetworkBehaviour or NetworkManager Cannot Be Added",$"{nameof(NetworkManager)}s cannot have {nameof(NetworkBehaviour)} components added to the root parent or any of its children."+
271
+
$" Would you like to remove the NetworkManager or NetworkBehaviour?","NetworkManager","NetworkBehaviour"))
272
+
{
273
+
DestroyImmediate(networkManager);
274
+
}
275
+
else
276
+
{
277
+
foreach(varnetworkBehaviourinnetworkBehaviours)
278
+
{
279
+
DestroyImmediate(networkBehaviour);
280
+
}
281
+
282
+
foreach(varnetworkBehaviourinnetworkBehaviours)
283
+
{
284
+
DestroyImmediate(networkBehaviour);
285
+
}
286
+
}
287
+
return;
288
+
}
289
+
}
257
290
258
291
// Otherwise, check to see if there is any NetworkObject from the root GameObject down to all children.
259
292
// If not, notify the user that NetworkBehaviours require that the relative GameObject has a NetworkObject component.
0 commit comments