public static long ReadPackedInt64(this NetworkReader reader) { var data = reader.ReadPackedUInt64(); return(ZigZag.Decode(data)); }
/// <exception cref="OverflowException">throws if values overflows uint</exception> public static uint ReadPackedUInt32(this NetworkReader reader) => checked ((uint)reader.ReadPackedUInt64());
// 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)); }