From 951a344addeef3fc6131419b5351eee5960133a4 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Nov 2024 15:56:54 -0600 Subject: [PATCH 1/2] fix Assign the current NetworkObject prefab to be updated. --- com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index 3ccd8ea72e..d1a0971375 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -106,6 +106,7 @@ public uint PrefabIdHash internal void RefreshAllPrefabInstances() { var instanceGlobalId = GlobalObjectId.GetGlobalObjectIdSlow(this); + NetworkObjectRefreshTool.PrefabNetworkObject = this; if (!PrefabUtility.IsPartOfAnyPrefab(this) || instanceGlobalId.identifierType != k_ImportedAssetObjectType) { EditorUtility.DisplayDialog("Network Prefab Assets Only", "This action can only be performed on a network prefab asset.", "Ok"); From 3225fd87c75860d5687bd1cbf05b4511433d1d71 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Nov 2024 15:57:42 -0600 Subject: [PATCH 2/2] style adding comment --- com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs index d1a0971375..74803aa428 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs @@ -106,6 +106,7 @@ public uint PrefabIdHash internal void RefreshAllPrefabInstances() { var instanceGlobalId = GlobalObjectId.GetGlobalObjectIdSlow(this); + // Assign the currently selected instance to be updated NetworkObjectRefreshTool.PrefabNetworkObject = this; if (!PrefabUtility.IsPartOfAnyPrefab(this) || instanceGlobalId.identifierType != k_ImportedAssetObjectType) {