public void sendChatMessage() { if (ChatInputField.text != "") { string line = Singleton.Singleton.Instance.Me.Username + ": " + ChatInputField.text + '\n'; SingletonUI.Instance.ChatView.text += line; MessagePacket packet = new MessagePacket(GameProtocol.GlobalChatMessagePacketID(), line); Singleton.Singleton.Instance.Connection.SendPacket(packet.getData()); ChatInputField.text = ""; } }