From 96ad442516d09250acf6bfc2bbcf90543b6e461b Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Mon, 2 Oct 2023 17:50:47 -0500 Subject: [PATCH 1/2] update Removing the invocation of process scene from the OnValidate. --- com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 2055d766a6..4566e2ec2e 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -51,6 +51,7 @@ public uint PrefabIdHash /// /// Object Types + /// Parameter 0 of /// // 0 = Null (when considered a null object type we can ignore) // 1 = Imported Asset @@ -147,8 +148,6 @@ internal void GenerateGlobalObjectIdHash() // We must invoke this in order for the modifications to get saved with the scene (does not mark scene as dirty) PrefabUtility.RecordPrefabInstancePropertyModifications(this); } - - NetworkObjectRefreshTool.ProcessScene(gameObject.scene.path); } else // Otherwise, this is a standard network prefab asset so we just mark it dirty for the AssetDatabase to update it { From 17d63a33127870c1efceb316109028b5e84e246f Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Mon, 2 Oct 2023 17:54:58 -0500 Subject: [PATCH 2/2] update Just merging GenerateGlobalObjectIdHash into OnValidate (no reason to have the method call a method). --- com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 4566e2ec2e..fe4016af81 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -98,11 +98,6 @@ internal void RefreshAllPrefabInstances() } private void OnValidate() - { - GenerateGlobalObjectIdHash(); - } - - internal void GenerateGlobalObjectIdHash() { // do NOT regenerate GlobalObjectIdHash for NetworkPrefabs while Editor is in PlayMode if (EditorApplication.isPlaying && !string.IsNullOrEmpty(gameObject.scene.name))