Skip to content

Commit 28a0ef5

Browse files
committed
remove comments + added todo comment
1 parent 159d1ab commit 28a0ef5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

com.unity.netcode.gameobjects/Runtime/Messaging/Messages/DestroyObjectMessage.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal struct DestroyObjectMessage : INetworkMessage, INetworkSerializeByMemcp
1313
private const string k_Name = "DestroyObjectMessage";
1414

1515
public ulong NetworkObjectId;
16-
private byte m_DestroyFlags;
16+
private byte m_DestroyFlags; // TO DO check naming
1717

1818
internal int DeferredDespawnTick;
1919
// Temporary until we make this a list
@@ -25,15 +25,14 @@ internal struct DestroyObjectMessage : INetworkMessage, INetworkSerializeByMemcp
2525
private const byte k_IsDeferredDespawn = 0x02;
2626
private const byte k_DestroyGameObject = 0x04;
2727

28-
internal bool IsTargetedDestroy; // Get bit [(bitField & (1 << bitPosition)) != 0;] with bitPosition= 0
29-
// set (byte)((bitField & ~(1 << bitPosition)) | (ToByte(value) << bitPosition))
30-
private bool m_IsDeferredDespawn; // 1
28+
internal bool IsTargetedDestroy;
29+
private bool m_IsDeferredDespawn;
3130

3231
/// <summary>
3332
/// Used to communicate whether to destroy the associated game object.
3433
/// Should be false if the object is InScenePlaced and true otherwise
3534
/// </summary>
36-
public bool DestroyGameObject; // 2
35+
public bool DestroyGameObject;
3736

3837
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3938
internal uint GetBitsetRepresentation()
@@ -58,13 +57,13 @@ public void Serialize(FastBufferWriter writer, int targetVersion)
5857
// Set deferred despawn flag
5958
m_IsDeferredDespawn = DeferredDespawnTick > 0;
6059

61-
uint getBitsetRepresentation = GetBitsetRepresentation();
60+
uint bitsetRepresentation = GetBitsetRepresentation();
6261

6362
BytePacker.WriteValueBitPacked(writer, NetworkObjectId);
6463

6564
if (IsDistributedAuthority)
6665
{
67-
writer.WriteValueSafe(getBitsetRepresentation);
66+
writer.WriteValueSafe(bitsetRepresentation);
6867

6968
if (IsTargetedDestroy)
7069
{
@@ -78,7 +77,7 @@ public void Serialize(FastBufferWriter writer, int targetVersion)
7877
}
7978
else if (targetVersion >= k_AllowDestroyGameInPlaced)
8079
{
81-
writer.WriteValueSafe(getBitsetRepresentation);
80+
writer.WriteValueSafe(bitsetRepresentation);
8281
}
8382

8483
if (targetVersion < k_OptimizeDestroyObjectMessage)

0 commit comments

Comments
 (0)