예제 #1
0
        public static long ReadPackedInt64(this NetworkReader reader)
        {
            var data = reader.ReadPackedUInt64();

            return(ZigZag.Decode(data));
        }
예제 #2
0
 /// <exception cref="OverflowException">throws if values overflows uint</exception>
 public static uint ReadPackedUInt32(this NetworkReader reader) => checked ((uint)reader.ReadPackedUInt64());
예제 #3
0
        // zigzag decoding https://gist.github.com/mfuerstenau/ba870a29e16536fdbaba
        public static long ReadPackedInt64(this NetworkReader reader)
        {
            ulong data = reader.ReadPackedUInt64();

            return(((long)(data >> 1)) ^ -((long)data & 1));
        }