Add NetworkMessage Guid write and read methods
This commit is contained in:
@@ -275,6 +275,24 @@ namespace FlaxEngine.Networking
|
||||
return new string(bytes, 0, stringLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes data of type <see cref="Guid"/> into the message.
|
||||
/// </summary>
|
||||
public void WriteGuid(Guid value)
|
||||
{
|
||||
WriteBytes((byte*)&value, sizeof(Guid));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads and returns data of type <see cref="Guid"/> from the message.
|
||||
/// </summary>
|
||||
public Guid ReadGuid()
|
||||
{
|
||||
var guidData = stackalloc Guid[1];
|
||||
ReadBytes((byte*)guidData, sizeof(Guid));
|
||||
return guidData[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes data of type <see cref="Vector2"/> into the message.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user