Skip to content

Commit a5c0130

Browse files
fix: GlobalObjectIdHash Generation (missed changes) (#2721)
* update Removing the invocation of process scene from the OnValidate. * update Just merging GenerateGlobalObjectIdHash into OnValidate (no reason to have the method call a method).
1 parent aa7ecbf commit a5c0130

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public uint PrefabIdHash
5151

5252
/// <summary>
5353
/// Object Types <see href="https://docs.unity3d.com/ScriptReference/GlobalObjectId.html"/>
54+
/// Parameter 0 of <see cref="k_GlobalIdTemplate"/>
5455
/// </summary>
5556
// 0 = Null (when considered a null object type we can ignore)
5657
// 1 = Imported Asset
@@ -97,11 +98,6 @@ internal void RefreshAllPrefabInstances()
9798
}
9899

99100
private void OnValidate()
100-
{
101-
GenerateGlobalObjectIdHash();
102-
}
103-
104-
internal void GenerateGlobalObjectIdHash()
105101
{
106102
// do NOT regenerate GlobalObjectIdHash for NetworkPrefabs while Editor is in PlayMode
107103
if (EditorApplication.isPlaying && !string.IsNullOrEmpty(gameObject.scene.name))
@@ -147,8 +143,6 @@ internal void GenerateGlobalObjectIdHash()
147143
// We must invoke this in order for the modifications to get saved with the scene (does not mark scene as dirty)
148144
PrefabUtility.RecordPrefabInstancePropertyModifications(this);
149145
}
150-
151-
NetworkObjectRefreshTool.ProcessScene(gameObject.scene.path);
152146
}
153147
else // Otherwise, this is a standard network prefab asset so we just mark it dirty for the AssetDatabase to update it
154148
{

0 commit comments

Comments
 (0)