Skip to content

Commit 49e149e

Browse files
chore: remove setting GhostField value work around (#4108)
update Removing the work around method as setting GhostField<T>.Value after instantiating works now.
1 parent 36111b2 commit 49e149e

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Unity.Netcode
1111
/// specific to the N4E-spawned hybrid prefab instance that has the matching <see cref="NetworkObjectId"/>.
1212
/// </summary>
1313

14-
[DefaultExecutionOrder(GhostObjectExecutionOrder.ExecutionOrder + 1)]
14+
[DefaultExecutionOrder(GhostObject.ExecutionOrder + 1)]
1515
//BREAK --- Fix this on UNIFIED side 1st
1616
public partial class NetworkObjectBridge : GhostBehaviour
1717
{
@@ -61,11 +61,6 @@ private void OnValidate()
6161
/// N4E-spawned hybrid prefab instances.
6262
/// </summary>
6363
internal GhostField<ulong> NetworkObjectId = new GhostField<ulong>();
64-
public void SetNetworkObjectId(ulong networkObjectId)
65-
{
66-
NetworkObjectId.PresetValue(networkObjectId);
67-
NetworkObjectId.Value = networkObjectId;
68-
}
6964

7065
/// <summary>
7166
/// Currently, NGO provides the parenting event handling via <see cref="ParentSyncMessage"/>.

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ internal bool AuthorityLocalSpawn([NotNull] NetworkObject networkObject, ulong n
11761176
// the NetworkObject is fully spawned.
11771177
if (networkObject.HasGhost)
11781178
{
1179-
networkObject.NetworkObjectBridge.SetNetworkObjectId(networkObject.NetworkObjectId);
1179+
networkObject.NetworkObjectBridge.NetworkObjectId.Value = networkObject.NetworkObjectId;
11801180
}
11811181
#endif
11821182

0 commit comments

Comments
 (0)