feat: added LiteNetLib networking integration
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using LiteNetLib.Utils;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
|
||||
namespace Syntriax.Engine.Systems.Network;
|
||||
|
||||
internal static class Vector3DNetPacker
|
||||
{
|
||||
internal static void Write(NetDataWriter writer, Vector3D data)
|
||||
{
|
||||
writer.Put(data.X);
|
||||
writer.Put(data.Y);
|
||||
writer.Put(data.Z);
|
||||
}
|
||||
|
||||
internal static Vector3D Read(NetDataReader reader)
|
||||
{
|
||||
float x = reader.GetFloat();
|
||||
float y = reader.GetFloat();
|
||||
float z = reader.GetFloat();
|
||||
|
||||
return new Vector3D(x, y, z);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user