NetPacketProcessorSubscribeT, TUserData(ActionT, TUserData, FuncT) Method |
Register and subscribe to packet receive event (with userData)
Namespace: LiteNetLib.UtilsAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntaxpublic void Subscribe<T, TUserData>(
Action<T, TUserData> onReceive,
Func<T> packetConstructor
)
where T : class, new()
Parameters
- onReceive ActionT, TUserData
- 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
- TUserData
Exceptions
See Also