//public static void Read(UnityEngine.Networking.NetworkMessage msg) : this() //{ // UnityEngine.Networking.NetworkReader reader = msg.reader; // int count = System.Math.Min(40, reader.Length); // for (int i = (int)reader.Position; i < count; ++i) // { // byte by = reader.ReadByte(); // this.Write(by); // } //} public static void Read(this UnityEngine.Networking.NetworkReader reader, ref Bitstream bitstream) { // Copy the reader into our buffer so we can extra the packed bits. UNET uses a byte reader so we can't directly read bit fragments out of it. int count = System.Math.Min(40, reader.Length); for (int i = (int)reader.Position; i < count; ++i) { byte b = reader.ReadByte(); bitstream.WriteByte(b); } }
public override void Deserialize(UnityEngine.Networking.NetworkReader reader) { this.Height = reader.ReadSingle(); }