-
Notifications
You must be signed in to change notification settings - Fork 0
/
UMVector3.cs
43 lines (34 loc) · 799 Bytes
/
UMVector3.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using DarkRift;
namespace UnityMultiplayerDRPlugin.DTOs
{
public class UMVector3 : DarkRift.IDarkRiftSerializable
{
public float x;
public float y;
public float z;
public UMVector3(){}
public UMVector3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public override string ToString()
{
return $"(X: {x}, Y: {y}, Z: {z})";
}
public void Deserialize(DeserializeEvent e)
{
x = e.Reader.ReadSingle();
y = e.Reader.ReadSingle();
z = e.Reader.ReadSingle();
}
public void Serialize(SerializeEvent e)
{
e.Writer.Write(x);
e.Writer.Write(y);
e.Writer.Write(z);
}
}
}