Skip to content

Commit 7be043a

Browse files
update
Changing GhostAdapter to GhostObject
1 parent 92d8bb9 commit 7be043a

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ public class NetworkObjectEditor : UnityEditor.Editor
2929

3030
#if UNIFIED_NETCODE
3131
/// <summary>
32-
/// Register for the GhostAdapter removal event.
32+
/// Register for the GhostObject removal event.
3333
/// </summary>
3434
[InitializeOnLoadMethod]
3535
private static void OnApplicationStart()
3636
{
37-
GhostAdapterEditor.OnGhostAdapterPreRemoval = OnGhostAdapterPreRemoval;
37+
GhostObjectEditor.OnGhostAdapterPreRemoval = OnGhostAdapterPreRemoval;
3838
}
3939

4040
/// <summary>
41-
/// Callback to remove the GhostBehaviours prior to removing GhostAdapter.
41+
/// Callback to remove the GhostBehaviours prior to removing GhostObject.
4242
/// </summary>
43-
/// <param name="gameObject">The <see cref="GameObject"/> with the <see cref="GhostAdapter"/> component being removed.</param>
43+
/// <param name="gameObject">The <see cref="GameObject"/> with the <see cref="GhostObject"/> component being removed.</param>
4444
private static void OnGhostAdapterPreRemoval(GameObject gameObject)
4545
{
4646
var ghostBehaviours = gameObject.GetComponentsInChildren<GhostBehaviour>();
@@ -49,7 +49,7 @@ private static void OnGhostAdapterPreRemoval(GameObject gameObject)
4949
DestroyImmediate(ghostBehaviours[i], true);
5050
}
5151
var networkObject = gameObject.GetComponent<NetworkObject>();
52-
networkObject.GhostAdapter = null;
52+
networkObject.GhostObject = null;
5353
networkObject.HasGhost = false;
5454
networkObject.HadBridge = true;
5555
}

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

Lines changed: 2 additions & 2 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(GhostAdapterExecutionOrder.ExecutionOrder + 1)]
14+
[DefaultExecutionOrder(GhostObjectExecutionOrder.ExecutionOrder + 1)]
1515
//BREAK --- Fix this on UNIFIED side 1st
1616
public partial class NetworkObjectBridge : GhostBehaviour
1717
{
@@ -23,7 +23,7 @@ private void OnValidate()
2323
{
2424
hideFlags = HideFlags.HideInInspector;
2525

26-
var ghostAdapter = GetComponent<GhostAdapter>();
26+
var ghostAdapter = GetComponent<GhostObject>();
2727
if (ghostAdapter == null)
2828
{
2929
return;

com.unity.netcode.gameobjects/Runtime/Connection/NetworkClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class NetworkClient
5252
/// <summary>
5353
/// The ClientId of the NetworkClient
5454
/// </summary>
55-
public ulong ClientId;
55+
public ulong ClientId { get; internal set; }
5656

5757
/// <summary>
5858
/// The PlayerObject of the Client

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private void CheckForInScenePlaced()
365365
#if UNIFIED_NETCODE
366366
[HideInInspector]
367367
[SerializeField]
368-
internal GhostAdapter GhostAdapter;
368+
internal GhostObject GhostObject;
369369

370370
[HideInInspector]
371371
[SerializeField]
@@ -388,16 +388,16 @@ private void OnApplicationUpdate()
388388
internal void UnifiedValidation()
389389
{
390390
NetworkObjectBridge = GetComponent<NetworkObjectBridge>();
391-
GhostAdapter = GetComponent<GhostAdapter>();
391+
GhostObject = GetComponent<GhostObject>();
392392

393-
HasGhost = GhostAdapter != null;
393+
HasGhost = GhostObject != null;
394394
if (HasGhost)
395395
{
396396
//TODO: Needs to be validated once develop-2.0.0 is merged.
397397
if (InScenePlaced)
398398
{
399399
Debug.LogError($"This experimental version of NGO does not support hybrid in-scene placed objects.");
400-
Destroy(GhostAdapter);
400+
Destroy(GhostObject);
401401
HasGhost = false;
402402
return;
403403
}
@@ -420,7 +420,7 @@ public void ApplyScale(Vector3 scale)
420420
{
421421
if (HasGhost)
422422
{
423-
GhostAdapter.ApplyPostTransformMatrixScale(scale);
423+
GhostObject.ApplyPostTransformMatrixScale(scale);
424424
}
425425
}
426426
#endif
@@ -3933,7 +3933,7 @@ private void InitGhost()
39333933
return;
39343934
}
39353935

3936-
if (!HasGhost || !NetworkObjectBridge || GhostAdapter.IsPrefab())
3936+
if (!HasGhost || !NetworkObjectBridge || GhostObject.IsPrefab())
39373937
{
39383938
// Nothing to register
39393939
return;
@@ -3944,7 +3944,7 @@ private void InitGhost()
39443944
{
39453945
Debug.Log($"[{nameof(NetworkObject)}] GhostBridge {name} detected and instantiated.");
39463946
}
3947-
if (GhostAdapter.WasInitialized && NetworkObjectBridge.NetworkObjectId.Value != 0)
3947+
if (GhostObject.WasInitialized && NetworkObjectBridge.NetworkObjectId.Value != 0)
39483948
{
39493949
NetworkManager.SpawnManager.GhostSpawnManager.RegisterGhostBridge(NetworkObjectBridge.NetworkObjectId.Value, this);
39503950
}

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ protected GameObject CreateHybridPrefab(string baseName, bool moveToDDOL = true)
24552455

24562456
// NetworkObject Ghost specific settings
24572457
no.HasGhost = true;
2458-
no.GhostAdapter = adapter;
2458+
no.GhostObject = adapter;
24592459
no.HadBridge = true;
24602460
no.NetworkObjectBridge = bridge;
24612461

0 commit comments

Comments
 (0)