Skip to content

Commit 62cef25

Browse files
author
Unity Technologies
committed
## [1.9.3] - 2025-11-06 ### Fixed * You can again add multiple `Entity` types to your ghost components and commands. * Shorts are now properly supported in components and commands. * Missing Physics-related API docs have been re-added.
1 parent 30d4487 commit 62cef25

File tree

10 files changed

+243
-48
lines changed

10 files changed

+243
-48
lines changed

.attestation.p7m

0 Bytes
Binary file not shown.

.signature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":1762363761,"signature":"qi4oHaTZSsgaIB/Dcdd+Vl8ZMjaw+4gfNNDWMc/UvD0fy9Qv7tHSHt3vWAvrUVOBhEMEUTMpUqhHL/38vPtnSXV81zhIhy2aoLQN8OI4XC52SaW81/hzVQsKcDutqvCdYe2sll7om2LpXuLVXE8AXYGxSmPqEOeWVZEG/2Lx1xP/28BDFtd6KYB0LZrp3CTW57yPkGjgkTrLVtRfcNOkALsDpoNL6oyDMYTjB5aG+7WDZmzodEU/haoxCiABSGlo9FgqLAab0vAVKCTMi6rboqIOgM8/2Lw9OFGc16AfVNIQJrvZs6NO4DoA6T8UMmfKfQtgTzu3idDDc+aCTJsbglh6u+pyCB1ynKWSah1osoL6i5JgKA1ZtQ8hPrP9KuDg7TVpGh9hoWXsSe4YykiH2hYpPIUMDs/eBuQfQxs94YoU61gp39yRrxXRdzwxfpsUySSyayzfw/ahNeGhrFFayo2EUHRWOSigpS/M7qRPD1pBwcrFNweBcnw7pC4FZAWo","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2V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LCOHXKhLeAj55rYDbd4Kd/eoZdDwqiFN2DnWBfE3Z2","publicKey":"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQm9qQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FZOEFNSUlCaWdLQ0FZRUFzdUhXYUhsZ0I1cVF4ZEJjTlJKSAordHR4SmoxcVY1NTdvMlZaRE1XaXhYRVBkRTBEMVFkT1JIRXNSS1RscmplUXlERU83ZlNQS0ZwZ1A3MU5TTnJCCkFHM2NFSU45aHNQVDhOVmllZmdWem5QTkVMenFkVmdEbFhpb2VpUnV6OERKWFgvblpmU1JWKytwbk9ySTRibG4KS0twelJlNW14OTc1SjhxZ1FvRktKT0NNRlpHdkJMR2MxSzZZaEIzOHJFODZCZzgzbUovWjBEYkVmQjBxZm13cgo2ZDVFUXFsd0E5Y3JZT1YyV1VpWXprSnBLNmJZNzRZNmM1TmpBcEFKeGNiaTFOaDlRVEhUcU44N0ZtMDF0R1ZwCjVNd1pXSWZuYVRUemEvTGZLelR5U0pka0tldEZMVGdkYXpMYlpzUEE2aHBSK0FJRTJhc0tLTi84UUk1N3UzU2cKL2xyMnZKS1IvU2l5eEN1Q20vQWJkYnJMbXk0WjlSdm1jMGdpclA4T0lLQWxBRWZ2TzV5Z2hSKy8vd1RpTFlzUQp1SllDM0V2UE16ZGdKUzdGR2FscnFLZzlPTCsxVzROY05yNWdveVdSUUJ0cktKaWlTZEJVWmVxb0RvSUY5NHpCCndGbzJJT1JFdXFqcU51M3diMWZIM3p1dGdtalFra3IxVjJhd3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
uid: changelog
33
---
44

5+
## [1.9.3] - 2025-11-06
6+
7+
### Fixed
8+
9+
* You can again add multiple `Entity` types to your ghost components and commands.
10+
* Shorts are now properly supported in components and commands.
11+
* Missing Physics-related API docs have been re-added.
12+
13+
514
## [1.9.2] - 2025-10-31
615

716
### Fixed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pmdt-additional-preprocessors": "ENABLE_UNITY_NETCODE_PHYSICS"
3+
}

Runtime/SourceGenerators/Templates/DefaultTypes/GhostSnapshotValueEntity.NetCodeSourceGenerator.additionalfile

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ namespace Generated
2626
if (true)
2727
{
2828
#region __GHOST_COPY_TO_SNAPSHOT__
29-
snapshot.__GHOST_FIELD_NAME__ = 0;
30-
snapshot.__GHOST_FIELD_NAME__SpawnTick = Unity.NetCode.NetworkTick.Invalid.SerializedData;
31-
if (serializerState.GhostFromEntity.TryGetComponent(component.__GHOST_FIELD_REFERENCE__, out var ghostComponent))
3229
{
33-
snapshot.__GHOST_FIELD_NAME__ = ghostComponent.ghostId;
34-
snapshot.__GHOST_FIELD_NAME__SpawnTick = ghostComponent.spawnTick.SerializedData;
30+
snapshot.__GHOST_FIELD_NAME__ = 0;
31+
snapshot.__GHOST_FIELD_NAME__SpawnTick = Unity.NetCode.NetworkTick.Invalid.SerializedData;
32+
if (serializerState.GhostFromEntity.TryGetComponent(component.__GHOST_FIELD_REFERENCE__, out var ghostComponent))
33+
{
34+
snapshot.__GHOST_FIELD_NAME__ = ghostComponent.ghostId;
35+
snapshot.__GHOST_FIELD_NAME__SpawnTick = ghostComponent.spawnTick.SerializedData;
36+
}
3537
}
3638
#endregion
3739
}
@@ -81,27 +83,31 @@ namespace Generated
8183
public void SerializeCommand(ref DataStreamWriter writer, in IComponentData data, in IComponentData baseline, in RpcSerializerState state, StreamCompressionModel compressionModel)
8284
{
8385
#region __COMMAND_WRITE__
84-
if (state.GhostFromEntity.TryGetComponent(data.__COMMAND_FIELD_NAME__, out var ghostComponent))
8586
{
86-
writer.WriteInt(ghostComponent.ghostId);
87-
writer.WriteUInt(ghostComponent.spawnTick.SerializedData);
88-
}
89-
else
90-
{
91-
writer.WriteInt(0);
92-
writer.WriteUInt(Unity.NetCode.NetworkTick.Invalid.SerializedData);
87+
if (state.GhostFromEntity.TryGetComponent(data.__COMMAND_FIELD_NAME__, out var ghostComponent))
88+
{
89+
writer.WriteInt(ghostComponent.ghostId);
90+
writer.WriteUInt(ghostComponent.spawnTick.SerializedData);
91+
}
92+
else
93+
{
94+
writer.WriteInt(0);
95+
writer.WriteUInt(Unity.NetCode.NetworkTick.Invalid.SerializedData);
96+
}
9397
}
9498
#endregion
9599
#region __COMMAND_WRITE_PACKED__
96-
if (state.GhostFromEntity.TryGetComponent(data.__COMMAND_FIELD_NAME__, out var ghostComponent))
97100
{
98-
writer.WriteInt(ghostComponent.ghostId);
99-
writer.WriteUInt(ghostComponent.spawnTick.SerializedData);
100-
}
101-
else
102-
{
103-
writer.WriteInt(0);
104-
writer.WriteUInt(Unity.NetCode.NetworkTick.Invalid.SerializedData);
101+
if (state.GhostFromEntity.TryGetComponent(data.__COMMAND_FIELD_NAME__, out var ghostComponent))
102+
{
103+
writer.WriteInt(ghostComponent.ghostId);
104+
writer.WriteUInt(ghostComponent.spawnTick.SerializedData);
105+
}
106+
else
107+
{
108+
writer.WriteInt(0);
109+
writer.WriteUInt(Unity.NetCode.NetworkTick.Invalid.SerializedData);
110+
}
105111
}
106112
#endregion
107113
}

Runtime/SourceGenerators/Templates/DefaultTypes/GhostSnapshotValueShort.NetCodeSourceGenerator.additionalfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Generated
99
writer.WriteShort((short)data.__COMMAND_FIELD_NAME__);
1010
#endregion
1111
#region __COMMAND_WRITE_PACKED__
12-
writer.WritePackedInt((short)(data.__COMMAND_FIELD_NAME__, compressionModel);
12+
writer.WritePackedInt((short)data.__COMMAND_FIELD_NAME__, compressionModel);
1313
#endregion
1414
}
1515

Tests/Editor/GhostGenTestTypes.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ public void GhostValuesAreSerialized_IComponentData()
3131
testWorld.SpawnOnServer(ghostGameObject);
3232
var serverEntity = testWorld.TryGetSingletonEntity<GhostGenTestUtils.GhostGenTestType_IComponentData>(testWorld.ServerWorld);
3333
Assert.AreNotEqual(Entity.Null, serverEntity);
34-
var newClampValues = GhostGenTestUtils.CreateGhostValuesClamp_Values(42, serverEntity);
34+
var (newClampValues, newClampValues2) = GhostGenTestUtils.CreateGhostValuesClamp_Values(42, serverEntity);
3535
var newClampStrings = GhostGenTestUtils.CreateGhostValuesClamp_Strings(42);
3636
var newInterpolateValues = GhostGenTestUtils.CreateGhostValuesInterpolate(42);
37-
testWorld.ServerWorld.EntityManager.SetComponentData(serverEntity, new GhostGenTestUtils.GhostGenTestType_IComponentData {GhostGenTypesClamp_Values = newClampValues, GhostGenTypesClamp_Strings = newClampStrings, GhostGenTypesInterpolate = newInterpolateValues});
37+
testWorld.ServerWorld.EntityManager.SetComponentData(serverEntity, new GhostGenTestUtils.GhostGenTestType_IComponentData
38+
{
39+
GhostGenTypesClamp_Values = newClampValues,
40+
GhostGenTypesClamp_Values2 = newClampValues2,
41+
GhostGenTypesClamp_Strings = newClampStrings,
42+
GhostGenTypesInterpolate = newInterpolateValues
43+
});
3844

3945
// Connect and make sure the connection could be established
4046
testWorld.Connect();
@@ -52,14 +58,20 @@ public void GhostValuesAreSerialized_IComponentData()
5258
var serverValues = testWorld.ServerWorld.EntityManager.GetComponentData<GhostGenTestUtils.GhostGenTestType_IComponentData>(serverEntity);
5359
var clientValues = testWorld.ClientWorlds[0].EntityManager.GetComponentData<GhostGenTestUtils.GhostGenTestType_IComponentData>(clientEntity);
5460

55-
GhostGenTestUtils.VerifyGhostValuesClamp_Values(false, serverValues.GhostGenTypesClamp_Values, clientValues.GhostGenTypesClamp_Values, serverEntity, clientEntity);
61+
GhostGenTestUtils.VerifyGhostValuesClamp_Values(false, serverValues.GhostGenTypesClamp_Values, clientValues.GhostGenTypesClamp_Values, serverValues.GhostGenTypesClamp_Values2, clientValues.GhostGenTypesClamp_Values2, serverEntity, clientEntity);
5662
GhostGenTestUtils.VerifyGhostValuesClamp_Strings( serverValues.GhostGenTypesClamp_Strings, clientValues.GhostGenTypesClamp_Strings);
5763
GhostGenTestUtils.VerifyGhostValuesInterpolate(serverValues.GhostGenTypesInterpolate, clientValues.GhostGenTypesInterpolate);
5864

59-
newClampValues = GhostGenTestUtils.CreateGhostValuesClamp_Values(43, serverEntity);
65+
(newClampValues, newClampValues2) = GhostGenTestUtils.CreateGhostValuesClamp_Values(43, serverEntity);
6066
newClampStrings = GhostGenTestUtils.CreateGhostValuesClamp_Strings(43);
6167
newInterpolateValues = GhostGenTestUtils.CreateGhostValuesInterpolate(43);
62-
testWorld.ServerWorld.EntityManager.SetComponentData(serverEntity, new GhostGenTestUtils.GhostGenTestType_IComponentData {GhostGenTypesClamp_Values = newClampValues, GhostGenTypesClamp_Strings = newClampStrings, GhostGenTypesInterpolate = newInterpolateValues});
68+
testWorld.ServerWorld.EntityManager.SetComponentData(serverEntity, new GhostGenTestUtils.GhostGenTestType_IComponentData
69+
{
70+
GhostGenTypesClamp_Values = newClampValues,
71+
GhostGenTypesClamp_Values2 = newClampValues2,
72+
GhostGenTypesClamp_Strings = newClampStrings,
73+
GhostGenTypesInterpolate = newInterpolateValues
74+
});
6375

6476
for (int i = 0; i < 64; ++i)
6577
testWorld.Tick();
@@ -68,7 +80,7 @@ public void GhostValuesAreSerialized_IComponentData()
6880
serverValues = testWorld.ServerWorld.EntityManager.GetComponentData<GhostGenTestUtils.GhostGenTestType_IComponentData>(serverEntity);
6981
clientValues = testWorld.ClientWorlds[0].EntityManager.GetComponentData<GhostGenTestUtils.GhostGenTestType_IComponentData>(clientEntity);
7082

71-
GhostGenTestUtils.VerifyGhostValuesClamp_Values(false, serverValues.GhostGenTypesClamp_Values, clientValues.GhostGenTypesClamp_Values, serverEntity, clientEntity);
83+
GhostGenTestUtils.VerifyGhostValuesClamp_Values(false, serverValues.GhostGenTypesClamp_Values, clientValues.GhostGenTypesClamp_Values, serverValues.GhostGenTypesClamp_Values2, clientValues.GhostGenTypesClamp_Values2, serverEntity, clientEntity);
7284
GhostGenTestUtils.VerifyGhostValuesClamp_Strings( serverValues.GhostGenTypesClamp_Strings, clientValues.GhostGenTypesClamp_Strings);
7385
GhostGenTestUtils.VerifyGhostValuesInterpolate(serverValues.GhostGenTypesInterpolate, clientValues.GhostGenTypesInterpolate);
7486
}

0 commit comments

Comments
 (0)