public void RemoveCallback <T>(Action <T> callback) where T : new() { Type type = typeof(T); ProtoItem <T> item = (ProtoItem <T>)protoListListener.GetItemByType(type); item.OnClientReceiveOnce -= callback; }
public void RemoveCallback <T>(Action <T, NetworkingPlayer> callback) where T : new() { Type type = typeof(T); ProtoItem <T> item = (ProtoItem <T>)protoListListener.GetItemByType(type); item.OnServerReceiveOnce -= callback; }
/** 添加监听 */ public void AddCallback <T>(Action <int, T> callback) where T : new() { Type type = typeof(T); ProtoItem <T> item = (ProtoItem <T>)protoListListener.GetItemByType(type); item.OnClientReceiveTwo += callback; }