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
* update
Resolves MTT-7055.
Split apart the NetworkObjectRefreshTool from NetworkObject.
Made some updates that don't require any form of editor application update.
Added script in NetworkObject.RefreshAllPrefabInstances context menu method that handles refreshing the currently active scene and all enabled scenes in the build list.
Added dialog notification when attempting to do a NetworkObject Refresh on an in-scene placed prefab instance as opposed to a prefab instance.
* test
Made some minor updates for the manual test
* update
adding change log entry
* style
Added object type identifier constants for code clarity purposes.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
10
10
11
11
### Added
12
12
13
+
- Added context menu tool that provides users with the ability to quickly update the GlobalObjectIdHash value for all in-scene placed prefab instances that were created prior to adding a NetworkObject component to it. (#2707)
13
14
- Added methods NetworkManager.SetPeerMTU and NetworkManager.GetPeerMTU to be able to set MTU sizes per-peer (#2676)
// Sanity check to make sure this is a scene placed object
138
+
if(globalId.identifierType!=k_SceneObjectType)
139
+
{
140
+
// This should never happen, but in the event it does throw and error
141
+
Debug.LogError($"[{gameObject.name}] is detected as an in-scene placed object but its identifier is of type {globalId.identifierType}! **Report this error**");
142
+
}
143
+
144
+
// If this is a prefab instance
145
+
if(PrefabUtility.IsPartOfAnyPrefab(this))
146
+
{
147
+
// We must invoke this in order for the modifications to get saved with the scene (does not mark scene as dirty)
Debug.Log($"[GlobalObjectId Gen][{theAsset.gameObject.name}] Failed to get GUID or the local file identifier. Returning default ({instanceGlobalId}).");
114
201
returninstanceGlobalId;
115
202
}
116
203
117
-
// If we reached this point, then we are most likely opening a prefab to edit.
204
+
// Note: If we reached this point, then we are most likely opening a prefab to edit.
118
205
// The instanceGlobalId will be constructed as if it is a scene object, however when it
119
206
// is serialized its value will be treated as a file asset (the "why" to the below code).
120
207
121
-
// Construct an imported asset identifier with the type being a source asset (type 3).
0 commit comments