NetPacketProcessorSubscribeNetSerializableT, TUserData(ActionT, TUserData, FuncT) Method |
Registers a callback for a packet type that implements
INetSerializable, using a custom constructor and supporting user data.
Namespace: LiteNetLib.UtilsAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntaxpublic void SubscribeNetSerializable<T, TUserData>(
Action<T, TUserData> onReceive,
Func<T> packetConstructor
)
where T : INetSerializable
Parameters
- onReceive ActionT, TUserData
- The delegate to be executed when the packet is received.
- packetConstructor FuncT
- A function that returns a new instance of T.
Type Parameters
- T
- The type of the packet. Must implement INetSerializable.
- TUserData
- The type of the user data (typically NetPeer).
See Also