Why use Roslyn Source Generators instead of Reflection in game tools:
Reflection inspects properties at runtime, generating runtime allocations and boxing.
Our Source Generator automatically writes pure C# binary serialization methods during compilation:
[GenerateBinaryPacker]
public partial struct PlayerStatePacket {
public int PlayerId;
public float Health;
public Vector3 Position;
}
// Generator automatically emits: public void Serialize(Span<byte> dest) { ... }Zero runtime reflection overhead, 100% compatible with NativeAOT!