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: prefab incontext or inIsolation edit mode globalobjectidhash incorrect when using MPPM (#3162)
* fix
This fixes the issue with the GlobalObjectId value being incorrect when entering into play mode while still in prefab edit mode (InContext or InIsolation).
* fix
Minor fix to how we shutdown NetworkManager when exiting playmode to assure we follow the same steps as we do when the application quits.
* fix
InSceneObject needed to be checked for having a value before checking for the value.
* update
Removed legacy methods used to detect when in edit mode.
Updated comments.
* update
Adding changelog entry.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
15
15
16
16
### Fixed
17
17
18
+
- Fixed issue where the `NetworkObjectIdHash` value could be incorrect when entering play mode while still in prefab edit mode with pending changes and using MPPM. (#3162)
18
19
- Fixed issue where a sever only `NetworkManager` instance would spawn the actual `NetworkPrefab`'s `GameObject` as opposed to creating an instance of it. (#3160)
19
20
- Fixed issue where only the session owner (as opposed to all clients) would handle spawning prefab overrides properly when using a distributed authority network topology. (#3160)
20
21
- Fixed issue where an exception was thrown when calling `NetworkManager.Shutdown` after calling `UnityTransport.Shutdown`. (#3118)
// Check if this is an in-scnee placed NetworkObject (Special Case for In-Scene Placed).
275
+
if(IsSceneObject.HasValue&&IsSceneObject.Value)
169
276
{
170
-
// Sanity check to make sure this is a scene placed object
277
+
// Sanity check to make sure this is a scene placed object.
171
278
if(globalId.identifierType!=k_SceneObjectType)
172
279
{
173
-
// This should never happen, but in the event it does throw and error
280
+
// This should never happen, but in the event it does throw and error.
174
281
Debug.LogError($"[{gameObject.name}] is detected as an in-scene placed object but its identifier is of type {globalId.identifierType}! **Report this error**");
175
282
}
176
283
177
-
// If this is a prefab instance
284
+
// If this is a prefab instance, then we want to mark it as having been updated in order for the udpated GlobalObjectIdHash value to be saved.
178
285
if(PrefabUtility.IsPartOfAnyPrefab(this))
179
286
{
180
-
// We must invoke this in order for the modifications to get saved with the scene (does not mark scene as dirty)
287
+
// We must invoke this in order for the modifications to get saved with the scene (does not mark scene as dirty).
0 commit comments