public void OnSentSubscribe(MessageType type, ClientOnMessageSentDelegate callback) { if (onMessageSentDelegates.ContainsKey(type)) { onMessageSentDelegates[type] += callback; } else if (SHOW_LOGS) { string msgType = Enum.GetName(typeof(MessageType), type); string logMsg = String.Format("No delegate found for onSent MessageType.{0}", msgType); Debug.Log(logMsg); } }
protected void AddMessageDelegate(MessageType type, ClientOnMessageSentDelegate handler) { if (onMessageSentDelegates.ContainsKey(type) == false) { onMessageSentDelegates.Add(type, handler); } else if (SHOW_LOGS) { string msgType = Enum.GetName(typeof(MessageType), type); string logMsg = String.Format("OnReceivedHandler already registered for this message : {0}", msgType); Debug.LogError(logMsg); } }