Ejemplo n.º 1
0
 void OnReceivePacket(int id, UserPacketType type, Stream stream)
 {
     Debug.Log("ElChatScreenRecibe---: " + type);
     if (type == (byte)UserPacketType.Message)
     {
         Debug.Log("---Y es un mensaje");
         StringPacket packet = new StringPacket();
         packet.Deserialize(stream);
         if (NetworkManager.Instance.isServer)
         {
             // MessageManager manager = new MessageManager();
             MessageManager.Instance.SendMessage(packet.payload.message, 0);
         }
         messages.text += packet.payload.message + System.Environment.NewLine;
     }
 }