예제 #1
0
        void SendChatMessage(string msg)
        {
            //No point of sending if you have nothing to send
            if (msg.Length == 0)
            {
                return;
            }
            if (msg.Length > MaxChatMessageLength)
            {
                msg.Remove(MaxChatMessageLength);
            }
            string textToSend = MultiplayerManager.instance.MyNetworkPlayer.Name + ": " + msg;
            MessageSendChatMessage messageSendChat = new MessageSendChatMessage();

            messageSendChat.chatMessage = textToSend;
            MultiplayerManager.instance.SendNetworkMessage(messageSendChat, SendTo.All);
        }
예제 #2
0
 void SendChatMessage(string msg)
 {
     //No point of sending if you have nothing to send
     if (msg.Length == 0)
         return;
     if (msg.Length > MaxChatMessageLength)
         msg.Remove(MaxChatMessageLength);
     string textToSend = MultiplayerManager.instance.MyNetworkPlayer.Name + ": " + msg;
     MessageSendChatMessage messageSendChat = new MessageSendChatMessage();
     messageSendChat.chatMessage = textToSend;
     MultiplayerManager.instance.SendNetworkMessage(messageSendChat, SendTo.All);
 }
예제 #3
0
        public override void OnCalled(Message msg, NetIncomingMessage netMsg = null)
        {
            MessageSendChatMessage message = msg as MessageSendChatMessage;

            MultiplayerManager.instance.Chat.OnReceiveChatMessage(message.chatMessage);
        }