Пример #1
0
        public float Unpack(NetworkReader reader)
        {
            uint zig    = (uint)VarIntBlocksPacker.Unpack(reader, blockSize);
            int  scaled = ZigZag.Decode(zig);

            return(scaled * precision);
        }
Пример #2
0
        public void Pack(NetworkWriter writer, float value)
        {
            int  scaled = Mathf.RoundToInt(value * inversePrecision);
            uint zig    = ZigZag.Encode(scaled);

            VarIntBlocksPacker.Pack(writer, zig, blockSize);
        }