Exemple #1
0
        ///// <summary>
        ///// Write a compressed value to the bitstream. CompressedValue contains the bits used, so that no arugment is required for bits.
        ///// </summary>
        //public static void Write(this Bitstream bs, CompressedValue cv)
        //{
        //	bs.Write(cv.cvalue, cv.bits);
        //}

        /// <summary>
        /// Write the used bytes (based on the writer position) to the NetworkWriter.
        /// </summary>
        public static void Write(this UnityEngine.Networking.NetworkWriter writer, ref Bitstream bitstream)
        {
            // Write the packed bytes from the bitstream into the UNET writer.
            int count = bitstream.BytesUsed;

            for (int i = 0; i < count; ++i)
            {
                writer.Write(bitstream.ReadByte());
            }
        }
 public override void Serialize(UnityEngine.Networking.NetworkWriter writer)
 {
     writer.Write(this.Height);
 }