public static PlayerTextureMeta Deserialize(byte[] data)
        {
            PlayerTextureMeta result = null;

            using (MemoryStream m = new MemoryStream(data))
            {
                using (BinaryReader reader = new BinaryReader(m))
                {
                    var size        = reader.ReadInt32();
                    var textureData = reader.ReadBytes(size);

                    var metaSize       = reader.ReadInt32();
                    var metaSerialized = reader.ReadBytes(metaSize);

                    result = metaSerialized.ToToken() as PlayerTextureMeta;

                    if (result != null)
                    {
                        result._size        = size;
                        result._textureData = textureData;
                    }
                }
            }

            return(result);
        }
        public override void StreamDataReceived(BoltConnection connection, UdpStreamData data)
        {
            var playerTexture = PlayerTextureMeta.Deserialize(data.Data);

            // Retransmit
            if (playerTexture != null)
            {
                BrokerSystem.PublishTexture(playerTexture.TargetEntity, playerTexture.TargetTexture, connection);
            }
        }
        public void SendTexture(NetworkId entityId, Texture2D texture, BoltConnection origin)
        {
            if (BoltNetwork.Connections.Any() == false)
            {
                return;
            }

            var textureInfo = new PlayerTextureMeta(entityId, texture);

            SendTexture(textureInfo.Serialize(), origin);
        }