/// <summary> /// 聊天按钮 /// </summary> public void Btn_chat() { if (chatInput.text == "") { return; } if (nowChatIsTable) { Proto.OnChatInMatchTable data = new Proto.OnChatInMatchTable(); data.data = chatInput.text; SocketClient.SendMsg(Route.match_main_chat, data); chatInput.text = ""; return; } if (nowFriendUid == 0) { return; } FriendData tmp = PlayerInfo.friends[nowFriendUid]; if (tmp.sid == "") { return; } Proto.FriendChatReq msg = new Proto.FriendChatReq(); msg.uid = tmp.uid; msg.sid = tmp.sid; msg.data = chatInput.text; SocketClient.SendMsg(Route.info_friend_chat, msg); chatInput.text = ""; }
/// <summary> /// 桌子里聊天 /// </summary> /// <param name="msg"></param> void SVR_onChatInTable(string msg) { Proto.OnChatInMatchTable data = JsonUtility.FromJson <Proto.OnChatInMatchTable>(msg); string chatStr = "\n<color=lime>" + data.nickname + ":</color>" + data.data; tableChatMsg.Append(chatStr); if (nowChatIsTable) { chatContent.text += chatStr; } }