I want to inherit an abstract class which implements INetworkSerializable. My abstract class serializes one field:
public virtual void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref senderId);
}
And in my subclass class I have:
public override void NetworkSerialize<T>(BufferSerializer<T> serializer)
{
base.NetworkSerialize(serializer);
serializer.SerializeValue(ref exampleField);
}
Will this work? I don't see why it shouldn't do, but https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.4/manual/advanced-topics/serialization/inetworkserializable.html seems to imply that it won't, at the very bottom of that page, though I don't understand why.
Also, is there anyway I can have a field that I pass into the serializer be like a property so I don't have do to getters and setters? I tried before but it says I couldn't pass in properties with ref.
Thanks for the help!