Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.1k stars 430 forks source link

fix: Added necessary backend to use byte serializer within networkVariables #2943

Closed Ufabsther closed 1 week ago

Ufabsther commented 3 weeks ago

fix: #2920 correction : Missing Byte NetworkVariableSerializer initialization for byte

Users encounters nullReference exception while using NetworkVariable type. This pull request offers to remedy that issue by adding a new ByteSerializer Type and adding it to the initialization list.

Fixing Issue #2920

Changelog

Testing and Documentation

unity-cla-assistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

qjonathan commented 2 weeks ago

This solution does not compile for me you have void INetworkVariableSerializer.ReadWithAllocator(FastBufferReader reader, out byte value, Allocator allocator) which is not conform to the interface

and ByteUnpacker.ReadValueBitPacked(reader, out value); ReadValueBitPacked doesnt have a Byte version