NetPacketProcessorSubscribeNetSerializableT(ActionT) Method |
Registers a callback for a packet type that implements
INetSerializable and has a parameterless constructor.
Namespace: LiteNetLib.UtilsAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntaxpublic void SubscribeNetSerializable<T>(
Action<T> onReceive
)
where T : new(), INetSerializable
Parameters
- onReceive ActionT
- The delegate to be executed when the packet is received.
Type Parameters
- T
- The type of the packet. Must implement INetSerializable and have a new() constraint.
Remarks
To reduce allocations, this method uses a single internal reference to T for deserialization.
See Also