public void PrintRemoteMessage(String message, Color foreColor, Color backColor) { if (foreColor != null && message != null && message.Length > 0) { MessagePacket messagePacket = new MessagePacket(message, foreColor, backColor); if (VideoSync.HostedServer != null) { if (VideoSync.HostedServer.Running) { VideoSync.HostedServer.sendAll(messagePacket); } } if (VideoSync.WatchConnection != null) { if (VideoSync.WatchConnection.isConnected()) { VideoSync.WatchConnection.sendObject(messagePacket); } } } }
private void HandleMessagePacket(MessagePacket messagePacket) { if (messagePacket == null) { Debug.Log(new ArgumentNullException("MessagePacket was null.")); return; } if (messagePacket.Message == null) { Debug.Log(new NullReferenceException("Message was null.")); return; } if (messagePacket.ForeColor == null) { Debug.Log(new NullReferenceException("ForeColor was null.")); return; } if (messagePacket.BackColor == null) { Debug.Log(new NullReferenceException("BackColor was null.")); return; } AppendText(messagePacket.Message, messagePacket.ForeColor, messagePacket.BackColor); }