public void OffPacket(int id, Action <IProto> action) { LazySet <Action <IProto> > handlers = null; if (this.actions.TryGetValue(id, out handlers)) { handlers.Remove(action); } }
public bool Off(MessageDef type, Action <MessageDef, object[]> handler) { if (null == handler) { return(false); } LazySet <Action <MessageDef, object[]> > set = null; if (!this.handlers.TryGetValue(type, out set)) { return(false); } return(set.Remove(handler)); }