コード例 #1
0
 public static void WriteDecimalConverter(this NetworkWriter writer, decimal value)
 {
     // the only way to read it without allocations is to both read and
     // write it with the FloatConverter (which is not binary compatible
     // to writer.Write(decimal), hence why we use it here too)
     var converter = new UIntDecimal
     {
         decimalValue = value
     };
     writer.WriteUInt64(converter.longValue1);
     writer.WriteUInt64(converter.longValue2);
 }
コード例 #2
0
 public static void WriteDoubleConverter(this NetworkWriter writer, double value)
 {
     var converter = new UIntDouble
     {
         doubleValue = value
     };
     writer.WriteUInt64(converter.longValue);
 }