NetPacketProcessorSubscribeT(ActionT, FuncT) Method |
Register and subscribe to packet receive event
Namespace: LiteNetLib.UtilsAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntaxpublic void Subscribe<T>(
Action<T> onReceive,
Func<T> packetConstructor
)
where T : class, new()
Parameters
- onReceive ActionT
- event that will be called when packet deserialized with ReadPacket method
- packetConstructor FuncT
- Method that constructs packet instead of slow Activator.CreateInstance
Type Parameters
- T
Exceptions
See Also