mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
docs(NetworkWriter): doc comments for WriteBlittable (with benchmark) (#2459)
* docs(NetworkWriter): doc comments for WriteBlittable * Update Assets/Mirror/Runtime/NetworkWriter.cs
This commit is contained in:
parent
96a03a3d59
commit
800a3d934b
@ -140,8 +140,6 @@ public ArraySegment<byte> ToArraySegment()
|
||||
}
|
||||
|
||||
// WriteBlittable<T> from DOTSNET.
|
||||
// this is extremely fast, but only works for blittable types.
|
||||
//
|
||||
// Benchmark:
|
||||
// WriteQuaternion x 100k, Macbook Pro 2015 @ 2.2Ghz, Unity 2018 LTS (debug mode)
|
||||
//
|
||||
@ -160,11 +158,24 @@ public ArraySegment<byte> ToArraySegment()
|
||||
//
|
||||
// * without IsBlittable check
|
||||
// => 6x faster!
|
||||
//
|
||||
// Note:
|
||||
// WriteBlittable assumes same endianness for server & client.
|
||||
// All Unity 2018+ platforms are little endian.
|
||||
// => run NetworkWriterTests.BlittableOnThisPlatform() to verify!
|
||||
/// <summary>
|
||||
/// Copies blittable type to buffer
|
||||
/// <para>
|
||||
/// This is extremely fast, but only works for blittable types.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Note:
|
||||
/// WriteBlittable assumes same endianness for server and client.
|
||||
/// All Unity 2018+ platforms are little endian.<br/>
|
||||
/// => run NetworkWriterTests.BlittableOnThisPlatform() to verify!
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See <see href="https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types">Blittable and Non-Blittable Types</see>
|
||||
/// for more info.
|
||||
/// </remarks>
|
||||
/// <typeparam name="T">Needs to be unmanaged, see <see href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/unmanaged-types">unmanaged types</see></typeparam>
|
||||
/// <param name="value"></param>
|
||||
public unsafe void WriteBlittable<T>(T value)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user