/// <summary> /// Reads a 8 byte float from the buffer. This is always 8 bytes on the wire. /// </summary> public static double ReadDouble <T>(this ref T deserializer) where T : struct, IDeserializer { #if INCLUDE_IL2CPP return(BitConverter.ToDouble(BitConverter.GetBytes(deserializer.ReadUInt64()), 0)); #else ulong value = deserializer.ReadUInt64(); return(FloatConversion.ToDouble(value)); #endif }
/// <summary> /// Reads a 4 byte float from the buffer. This is always 4 bytes on the wire. /// </summary> public static float ReadSingle <T>(this ref T deserializer) where T : struct, IDeserializer { #if INCLUDE_IL2CPP return(BitConverter.ToSingle(BitConverter.GetBytes(deserializer.ReadUInt32()), 0)); #else uint value = deserializer.ReadUInt32(); return(FloatConversion.ToSingle(value)); #endif }