While investigating a concern about field ordering related to a Roslyn source generator from the Netcode for Entities package, a bug was discovered:
How to reproduce:
1. Create a component with two fields:
public struct MessyComponent : IComponentData
{
[GhostField] public int ValueA;
[GhostField] public int ValueB;
}
2. Create a build with that component
3. Switch the order of the two fields in the Editor:
public struct MessyComponent : IComponentData
{
[GhostField] public int ValueB; // swapped order
[GhostField] public int ValueA;
}
4. Create a client system reading the values
5. Run the Editor connecting to the older build
Actual result: The value updated server-side is going into the wrong field client-side
Expected result: the value updated server-side goes into the correct field client-side
Reproducible with: 6000.3.5f1
Reproduced on: Windows 11 (user reported)
Not reproduced on: No other environment tested
Note: This issue was not tested by CQA