NetSerializerSubscribeT Method (ActionT, FuncT) |
LiteNetLib |
Register and subscribe to packet receive event
Namespace: LiteNetLib.Utils
Assembly: LiteNetLib (in LiteNetLib.dll) Version: 1.0.0.0
Syntax
C#
public void Subscribe<T>( Action<T> onReceive, Func<T> packetConstructor ) where T : class, new()
Parameters
- onReceive
- Type: SystemActionT
event that will be called when packet deserialized with ReadPacket method - packetConstructor
- Type: SystemFuncT
Method that constructs packet intead of slow Activator.CreateInstance
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:LiteNetLib.Utils.NetSerializer.Subscribe``1(System.Action{``0},System.Func{``0})"]
See Also