void SVR_onFriendChat(string _msg) { Proto.FriendChatMsg msg = JsonUtility.FromJson <Proto.FriendChatMsg>(_msg); ChatData tmp = new ChatData(); tmp.info = msg.info; int friendUid = 0; if (msg.from == PlayerInfo.uid) { friendUid = msg.to; tmp.isMe = true; } else { friendUid = msg.from; tmp.isMe = false; } PlayerInfo.friends[friendUid].chatInfo.Add(tmp); ChatInfoTmp tmpMsg = new ChatInfoTmp(); tmpMsg.friendUid = friendUid; tmpMsg.info = tmp.info; tmpMsg.isMe = tmp.isMe; if (commonCb.ContainsKey(CommonHandlerCb.onFriendChat)) { commonCb[CommonHandlerCb.onFriendChat]?.Invoke(tmpMsg); } }
void OnFriendChat(object _msg) { ChatInfoTmp msg = _msg as ChatInfoTmp; ChatData tmp = new ChatData(); tmp.isMe = msg.isMe; tmp.info = msg.info; NewChat(msg.friendUid, tmp); }
void OnFriendChat(object _msg) { ChatInfoTmp msg = _msg as ChatInfoTmp; if (nowFriendUid != msg.friendUid || nowChatIsTable) { return; } if (msg.isMe) { chatContent.text += "\n<color=lime>→</color>" + msg.info; } else { chatContent.text += "\n<color=grey>→</color>" + msg.info; } }