[Add] FishNet

This commit is contained in:
2026-03-30 20:11:57 +07:00
parent ee793a3361
commit c22c08753a
1797 changed files with 197950 additions and 1 deletions
@@ -0,0 +1,490 @@
#if UNITYMATHEMATICS
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writebool2(bool2 value)
{
byte b = 0;
if (value.x)
b |= 1;
if (value.y)
b |= 2;
WriteUInt8Unpacked(b);
}
public void Writebool3(bool3 value)
{
byte b = 0;
if (value.x)
b |= 1;
if (value.y)
b |= 2;
if (value.z)
b |= 4;
WriteUInt8Unpacked(b);
}
public void Writebool4(bool4 value)
{
byte b = 0;
if (value.x)
b |= 1;
if (value.y)
b |= 2;
if (value.z)
b |= 4;
if (value.w)
b |= 8;
WriteUInt8Unpacked(b);
}
public void Writebool2x2(bool2x2 value)
{
byte b = 0;
if (value.c0.x)
b |= 1;
if (value.c0.y)
b |= 2;
if (value.c1.x)
b |= 4;
if (value.c1.y)
b |= 8;
WriteUInt8Unpacked(b);
}
public void Writebool2x3(bool2x3 value)
{
byte b = 0;
if (value.c0.x)
b |= 1;
if (value.c0.y)
b |= 2;
if (value.c1.x)
b |= 4;
if (value.c1.y)
b |= 8;
if (value.c2.x)
b |= 16;
if (value.c2.y)
b |= 32;
WriteUInt8Unpacked(b);
}
public void Writebool2x4(bool2x4 value)
{
byte b = 0;
if (value.c0.x)
b |= 1;
if (value.c0.y)
b |= 2;
if (value.c1.x)
b |= 4;
if (value.c1.y)
b |= 8;
if (value.c2.x)
b |= 16;
if (value.c2.y)
b |= 32;
if (value.c3.x)
b |= 64;
if (value.c3.y)
b |= 128;
WriteUInt8Unpacked(b);
}
public void Writebool3x2(bool3x2 value)
{
byte b = 0;
if (value.c0.x)
b |= 1;
if (value.c0.y)
b |= 2;
if (value.c0.z)
b |= 4;
if (value.c1.x)
b |= 8;
if (value.c1.y)
b |= 16;
if (value.c1.z)
b |= 32;
WriteUInt8Unpacked(b);
}
public void Writebool3x3(bool3x3 value)
{
ushort s = 0;
if (value.c0.x)
s |= 1;
if (value.c0.y)
s |= 2;
if (value.c0.z)
s |= 4;
if (value.c1.x)
s |= 8;
if (value.c1.y)
s |= 16;
if (value.c1.z)
s |= 32;
if (value.c2.x)
s |= 64;
if (value.c2.y)
s |= 128;
if (value.c2.z)
s |= 256;
WriteUInt16(s);
}
public void Writebool3x4(bool3x4 value)
{
ushort s = 0;
if (value.c0.x)
s |= 1;
if (value.c0.y)
s |= 2;
if (value.c0.z)
s |= 4;
if (value.c1.x)
s |= 8;
if (value.c1.y)
s |= 16;
if (value.c1.z)
s |= 32;
if (value.c2.x)
s |= 64;
if (value.c2.y)
s |= 128;
if (value.c2.z)
s |= 256;
if (value.c3.x)
s |= 512;
if (value.c3.y)
s |= 1024;
if (value.c3.z)
s |= 2048;
WriteUInt16(s);
}
public void Writebool4x2(bool4x2 value)
{
byte b = 0;
if (value.c0.x)
b |= 1;
if (value.c0.y)
b |= 2;
if (value.c0.z)
b |= 4;
if (value.c0.w)
b |= 8;
if (value.c1.x)
b |= 16;
if (value.c1.y)
b |= 32;
if (value.c1.z)
b |= 64;
if (value.c1.w)
b |= 128;
WriteUInt8Unpacked(b);
}
public void Writebool4x3(bool4x3 value)
{
ushort s = 0;
if (value.c0.x)
s |= 1;
if (value.c0.y)
s |= 2;
if (value.c0.z)
s |= 4;
if (value.c0.w)
s |= 8;
if (value.c1.x)
s |= 16;
if (value.c1.y)
s |= 32;
if (value.c1.z)
s |= 64;
if (value.c1.w)
s |= 128;
if (value.c2.x)
s |= 256;
if (value.c2.y)
s |= 512;
if (value.c2.z)
s |= 1024;
if (value.c2.w)
s |= 2048;
WriteUInt16(s);
}
public void Writebool4x4(bool4x4 value)
{
ushort s = 0;
if (value.c0.x)
s |= 1;
if (value.c0.y)
s |= 2;
if (value.c0.z)
s |= 4;
if (value.c0.w)
s |= 8;
if (value.c1.x)
s |= 16;
if (value.c1.y)
s |= 32;
if (value.c1.z)
s |= 64;
if (value.c1.w)
s |= 128;
if (value.c2.x)
s |= 256;
if (value.c2.y)
s |= 512;
if (value.c2.z)
s |= 1024;
if (value.c2.w)
s |= 2048;
if (value.c3.x)
s |= 4096;
if (value.c3.y)
s |= 8192;
if (value.c3.z)
s |= 16384;
if (value.c3.w)
s |= 32768;
WriteUInt16(s);
}
}
public partial class Reader
{
public bool2 Readbool2()
{
byte b = ReadUInt8Unpacked();
return new bool2() { x = (b & 1) != 0, y = (b & 2) != 0 };
}
public bool3 Readbool3()
{
byte b = ReadUInt8Unpacked();
return new bool3()
{
x = (b & 1) != 0,
y = (b & 2) != 0,
z = (b & 4) != 0
};
}
public bool4 Readbool4()
{
byte b = ReadUInt8Unpacked();
return new bool4
{
x = (b & 1) != 0,
y = (b & 2) != 0,
z = (b & 4) != 0,
w = (b & 8) != 0
};
}
public bool2x2 Readbool2x2()
{
byte b = ReadUInt8Unpacked();
bool2x2 value = default;
value.c0.x = (b & 1) != 0;
value.c0.y = (b & 2) != 0;
value.c1.x = (b & 4) != 0;
value.c1.y = (b & 8) != 0;
return value;
}
public bool2x3 Readbool2x3()
{
byte b = ReadUInt8Unpacked();
bool2x3 value = default;
value.c0.x = (b & 1) != 0;
value.c0.y = (b & 2) != 0;
value.c1.x = (b & 4) != 0;
value.c1.y = (b & 8) != 0;
value.c2.x = (b & 16) != 0;
value.c2.y = (b & 32) != 0;
return value;
}
public bool2x4 Readbool2x4()
{
byte b = ReadUInt8Unpacked();
bool2x4 value = default;
value.c0.x = (b & 1) != 0;
value.c0.y = (b & 2) != 0;
value.c1.x = (b & 4) != 0;
value.c1.y = (b & 8) != 0;
value.c2.x = (b & 16) != 0;
value.c2.y = (b & 32) != 0;
value.c3.x = (b & 64) != 0;
value.c3.y = (b & 128) != 0;
return value;
}
public bool3x2 Readbool3x2()
{
byte b = ReadUInt8Unpacked();
bool3x2 value = default;
value.c0.x = (b & 1) != 0;
value.c0.y = (b & 2) != 0;
value.c0.z = (b & 4) != 0;
value.c1.x = (b & 8) != 0;
value.c1.y = (b & 16) != 0;
value.c1.z = (b & 32) != 0;
return value;
}
public bool3x3 Readbool3x3()
{
ushort s = ReadUInt16();
bool3x3 value = default;
value.c0.x = (s & 1) != 0;
value.c0.y = (s & 2) != 0;
value.c0.z = (s & 4) != 0;
value.c1.x = (s & 8) != 0;
value.c1.y = (s & 16) != 0;
value.c1.z = (s & 32) != 0;
value.c2.x = (s & 64) != 0;
value.c2.y = (s & 128) != 0;
value.c2.z = (s & 256) != 0;
return value;
}
public bool3x4 Readbool3x4()
{
ushort s = ReadUInt16();
bool3x4 value = default;
value.c0.x = (s & 1) != 0;
value.c0.y = (s & 2) != 0;
value.c0.z = (s & 4) != 0;
value.c1.x = (s & 8) != 0;
value.c1.y = (s & 16) != 0;
value.c1.z = (s & 32) != 0;
value.c2.x = (s & 64) != 0;
value.c2.y = (s & 128) != 0;
value.c2.z = (s & 256) != 0;
value.c3.x = (s & 512) != 0;
value.c3.y = (s & 1024) != 0;
value.c3.z = (s & 2048) != 0;
return value;
}
public bool4x2 Readbool4x2()
{
byte b = ReadUInt8Unpacked();
bool4x2 value = default;
value.c0.x = (b & 1) != 0;
value.c0.y = (b & 2) != 0;
value.c0.z = (b & 4) != 0;
value.c0.w = (b & 8) != 0;
value.c1.x = (b & 16) != 0;
value.c1.y = (b & 32) != 0;
value.c1.z = (b & 64) != 0;
value.c1.w = (b & 128) != 0;
return value;
}
public bool4x3 Readbool4x3()
{
ushort s = ReadUInt16();
bool4x3 value = default;
value.c0.x = (s & 1) != 0;
value.c0.y = (s & 2) != 0;
value.c0.z = (s & 4) != 0;
value.c0.w = (s & 8) != 0;
value.c1.x = (s & 16) != 0;
value.c1.y = (s & 32) != 0;
value.c1.z = (s & 64) != 0;
value.c1.w = (s & 128) != 0;
value.c2.x = (s & 256) != 0;
value.c2.y = (s & 512) != 0;
value.c2.z = (s & 1024) != 0;
value.c2.w = (s & 2048) != 0;
return value;
}
public bool4x4 Readbool4x4()
{
ushort s = ReadUInt16();
bool4x4 value = default;
value.c0.x = (s & 1) != 0;
value.c0.y = (s & 2) != 0;
value.c0.z = (s & 4) != 0;
value.c0.w = (s & 8) != 0;
value.c1.x = (s & 16) != 0;
value.c1.y = (s & 32) != 0;
value.c1.z = (s & 64) != 0;
value.c1.w = (s & 128) != 0;
value.c2.x = (s & 256) != 0;
value.c2.y = (s & 512) != 0;
value.c2.z = (s & 1024) != 0;
value.c2.w = (s & 2048) != 0;
value.c3.x = (s & 4096) != 0;
value.c3.y = (s & 8192) != 0;
value.c3.z = (s & 16384) != 0;
value.c3.w = (s & 32768) != 0;
return value;
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 254b9133ed0260b4685ea1d28bd15df1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsBoolean.cs
uploadId: 866910
@@ -0,0 +1,217 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writedouble2(double2 value)
{
WriteDouble(value.x);
WriteDouble(value.y);
}
public void Writedouble3(double3 value)
{
WriteDouble(value.x);
WriteDouble(value.y);
WriteDouble(value.z);
}
public void Writedouble4(double4 value)
{
WriteDouble(value.x);
WriteDouble(value.y);
WriteDouble(value.z);
WriteDouble(value.w);
}
public void Writedouble2x2(double2x2 value)
{
Writedouble2(value.c0);
Writedouble2(value.c1);
}
public void Writedouble2x3(double2x3 value)
{
Writedouble2(value.c0);
Writedouble2(value.c1);
Writedouble2(value.c2);
}
public void Writedouble2x4(double2x4 value)
{
Writedouble2(value.c0);
Writedouble2(value.c1);
Writedouble2(value.c2);
Writedouble2(value.c3);
}
public void Writedouble3x2(double3x2 value)
{
Writedouble3(value.c0);
Writedouble3(value.c1);
}
public void Writedouble4x2(double4x2 value)
{
Writedouble4(value.c0);
Writedouble4(value.c1);
}
public void Writedouble3x4(double3x4 value)
{
Writedouble3(value.c0);
Writedouble3(value.c1);
Writedouble3(value.c2);
Writedouble3(value.c3);
}
public void Writedouble4x3(double4x3 value)
{
Writedouble4(value.c0);
Writedouble4(value.c1);
Writedouble4(value.c2);
}
public void Writedouble3x3(double3x3 value)
{
Writedouble3(value.c0);
Writedouble3(value.c1);
Writedouble3(value.c2);
}
public void Writedouble4x4(double4x4 value)
{
Writedouble4(value.c0);
Writedouble4(value.c1);
Writedouble4(value.c2);
Writedouble4(value.c3);
}
}
public partial class Reader
{
public double2 Readdouble2()
{
return new double2
{
x = ReadDouble(),
y = ReadDouble()
};
}
public double3 Readdouble3()
{
return new double3()
{
x = ReadDouble(),
y = ReadDouble(),
z = ReadDouble()
};
}
public double4 Readdouble4()
{
return new double4()
{
x = ReadDouble(),
y = ReadDouble(),
z = ReadDouble(),
w = ReadDouble()
};
}
public double2x2 Readdouble2x2()
{
return new double2x2()
{
c0 = Readdouble2(),
c1 = Readdouble2()
};
}
public double2x3 Readdouble2x3()
{
return new double2x3()
{
c0 = Readdouble2(),
c1 = Readdouble2(),
c2 = Readdouble2()
};
}
public double2x4 Readdouble2x4()
{
return new double2x4()
{
c0 = Readdouble2(),
c1 = Readdouble2(),
c2 = Readdouble2(),
c3 = Readdouble2()
};
}
public double3x2 Readdouble3x2()
{
return new double3x2()
{
c0 = Readdouble3(),
c1 = Readdouble3()
};
}
public double4x2 Readdouble4x2()
{
return new double4x2()
{
c0 = Readdouble4(),
c1 = Readdouble4()
};
}
public double3x4 Readdouble3x4()
{
return new double3x4()
{
c0 = Readdouble3(),
c1 = Readdouble3(),
c2 = Readdouble3(),
c3 = Readdouble3()
};
}
public double4x3 Readdouble4x3()
{
return new double4x3()
{
c0 = Readdouble4(),
c1 = Readdouble4(),
c2 = Readdouble4()
};
}
public double3x3 Readdouble3x3()
{
return new double3x3()
{
c0 = Readdouble3(),
c1 = Readdouble3(),
c2 = Readdouble3()
};
}
public double4x4 Readdouble4x4()
{
return new double4x4()
{
c0 = Readdouble4(),
c1 = Readdouble4(),
c2 = Readdouble4(),
c3 = Readdouble4()
};
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 5b02bb31d2808f94695dfa971bbe624b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsDouble.cs
uploadId: 866910
@@ -0,0 +1,217 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writefloat2(float2 value)
{
WriteSingle(value.x);
WriteSingle(value.y);
}
public void Writefloat3(float3 value)
{
WriteSingle(value.x);
WriteSingle(value.y);
WriteSingle(value.z);
}
public void Writefloat4(float4 value)
{
WriteSingle(value.x);
WriteSingle(value.y);
WriteSingle(value.z);
WriteSingle(value.w);
}
public void Writefloat2x2(float2x2 value)
{
Writefloat2(value.c0);
Writefloat2(value.c1);
}
public void Writefloat2x3(float2x3 value)
{
Writefloat2(value.c0);
Writefloat2(value.c1);
Writefloat2(value.c2);
}
public void Writefloat2x4(float2x4 value)
{
Writefloat2(value.c0);
Writefloat2(value.c1);
Writefloat2(value.c2);
Writefloat2(value.c3);
}
public void Writefloat3x2(float3x2 value)
{
Writefloat3(value.c0);
Writefloat3(value.c1);
}
public void Writefloat3x3(float3x3 value)
{
Writefloat3(value.c0);
Writefloat3(value.c1);
Writefloat3(value.c2);
}
public void Writefloat3x4(float3x4 value)
{
Writefloat3(value.c0);
Writefloat3(value.c1);
Writefloat3(value.c2);
Writefloat3(value.c3);
}
public void Writefloat4x2(float4x2 value)
{
Writefloat4(value.c0);
Writefloat4(value.c1);
}
public void Writefloat4x3(float4x3 value)
{
Writefloat4(value.c0);
Writefloat4(value.c1);
Writefloat4(value.c2);
}
public void Writefloat4x4(float4x4 value)
{
Writefloat4(value.c0);
Writefloat4(value.c1);
Writefloat4(value.c2);
Writefloat4(value.c3);
}
}
public partial class Reader
{
public float2 Readfloat2()
{
return new float2
{
x = ReadSingle(),
y = ReadSingle()
};
}
public float3 Readfloat3()
{
return new float3()
{
x = ReadSingle(),
y = ReadSingle(),
z = ReadSingle()
};
}
public float4 Readfloat4()
{
return new float4()
{
x = ReadSingle(),
y = ReadSingle(),
z = ReadSingle(),
w = ReadSingle()
};
}
public float2x2 Readfloat2x2()
{
return new float2x2()
{
c0 = Readfloat2(),
c1 = Readfloat2()
};
}
public float2x3 Readfloat2x3()
{
return new float2x3()
{
c0 = Readfloat2(),
c1 = Readfloat2(),
c2 = Readfloat2()
};
}
public float2x4 Readfloat2x4()
{
return new float2x4()
{
c0 = Readfloat2(),
c1 = Readfloat2(),
c2 = Readfloat2(),
c3 = Readfloat2()
};
}
public float3x2 Readfloat3x2()
{
return new float3x2()
{
c0 = Readfloat3(),
c1 = Readfloat3()
};
}
public float3x3 Readfloat3x3()
{
return new float3x3()
{
c0 = Readfloat3(),
c1 = Readfloat3(),
c2 = Readfloat3()
};
}
public float3x4 Readfloat3x4()
{
return new float3x4()
{
c0 = Readfloat3(),
c1 = Readfloat3(),
c2 = Readfloat3(),
c3 = Readfloat3()
};
}
public float4x2 Readfloat4x2()
{
return new float4x2()
{
c0 = Readfloat4(),
c1 = Readfloat4()
};
}
public float4x3 Readfloat4x3()
{
return new float4x3()
{
c0 = Readfloat4(),
c1 = Readfloat4(),
c2 = Readfloat4()
};
}
public float4x4 Readfloat4x4()
{
return new float4x4()
{
c0 = Readfloat4(),
c1 = Readfloat4(),
c2 = Readfloat4(),
c3 = Readfloat4()
};
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 501c2baf76f23f64fadc0fd46e2d95fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsFloat.cs
uploadId: 866910
@@ -0,0 +1,77 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writehalf(half value)
{
WriteUInt16(value.value);
}
public void Writehalf2(half2 value)
{
WriteUInt16(value.x.value);
WriteUInt16(value.y.value);
}
public void Writehalf3(half3 value)
{
WriteUInt16(value.x.value);
WriteUInt16(value.y.value);
WriteUInt16(value.z.value);
}
public void Writehalf4(half4 value)
{
WriteUInt16(value.x.value);
WriteUInt16(value.y.value);
WriteUInt16(value.z.value);
WriteUInt16(value.w.value);
}
}
public partial class Reader
{
public half Readhalf()
{
return new half { value = ReadUInt16() };
}
public half2 Readhalf2()
{
half2 h = default;
h.x.value = ReadUInt16();
h.y.value = ReadUInt16();
return h;
}
public half3 Readhalf3()
{
half3 h = default;
h.x.value = ReadUInt16();
h.y.value = ReadUInt16();
h.z.value = ReadUInt16();
return h;
}
public half4 Readhalf4()
{
half4 h = default;
h.x.value = ReadUInt16();
h.y.value = ReadUInt16();
h.z.value = ReadUInt16();
h.w.value = ReadUInt16();
return h;
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: eeb83ce2d1531bc4ea314600a3978c79
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsHalf.cs
uploadId: 866910
@@ -0,0 +1,217 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writeint2(int2 value)
{
WriteInt32(value.x);
WriteInt32(value.y);
}
public void Writeint3(int3 value)
{
WriteInt32(value.x);
WriteInt32(value.y);
WriteInt32(value.z);
}
public void Writeint4(int4 value)
{
WriteInt32(value.x);
WriteInt32(value.y);
WriteInt32(value.z);
WriteInt32(value.w);
}
public void Writeint2x2(int2x2 value)
{
Writeint2(value.c0);
Writeint2(value.c1);
}
public void Writeint2x3(int2x3 value)
{
Writeint2(value.c0);
Writeint2(value.c1);
Writeint2(value.c2);
}
public void Writeint2x4(int2x4 value)
{
Writeint2(value.c0);
Writeint2(value.c1);
Writeint2(value.c2);
Writeint2(value.c3);
}
public void Writeint3x2(int3x2 value)
{
Writeint3(value.c0);
Writeint3(value.c1);
}
public void Writeint3x3(int3x3 value)
{
Writeint3(value.c0);
Writeint3(value.c1);
Writeint3(value.c2);
}
public void Writeint3x4(int3x4 value)
{
Writeint3(value.c0);
Writeint3(value.c1);
Writeint3(value.c2);
Writeint3(value.c3);
}
public void Writeint4x2(int4x2 value)
{
Writeint4(value.c0);
Writeint4(value.c1);
}
public void Writeint4x3(int4x3 value)
{
Writeint4(value.c0);
Writeint4(value.c1);
Writeint4(value.c2);
}
public void Writeint4x4(int4x4 value)
{
Writeint4(value.c0);
Writeint4(value.c1);
Writeint4(value.c2);
Writeint4(value.c3);
}
}
public partial class Reader
{
public int2 Readint2()
{
return new int2
{
x = ReadInt32(),
y = ReadInt32()
};
}
public int3 Readint3()
{
return new int3()
{
x = ReadInt32(),
y = ReadInt32(),
z = ReadInt32()
};
}
public int4 Readint4()
{
return new int4()
{
x = ReadInt32(),
y = ReadInt32(),
z = ReadInt32(),
w = ReadInt32()
};
}
public int2x2 Readint2x2()
{
return new int2x2()
{
c0 = Readint2(),
c1 = Readint2()
};
}
public int2x3 Readint2x3()
{
return new int2x3()
{
c0 = Readint2(),
c1 = Readint2(),
c2 = Readint2()
};
}
public int2x4 Readint2x4()
{
return new int2x4()
{
c0 = Readint2(),
c1 = Readint2(),
c2 = Readint2(),
c3 = Readint2()
};
}
public int3x2 Readint3x2()
{
return new int3x2()
{
c0 = Readint3(),
c1 = Readint3()
};
}
public int3x3 Readint3x3()
{
return new int3x3()
{
c0 = Readint3(),
c1 = Readint3(),
c2 = Readint3()
};
}
public int3x4 Readint3x4()
{
return new int3x4()
{
c0 = Readint3(),
c1 = Readint3(),
c2 = Readint3(),
c3 = Readint3()
};
}
public int4x2 Readint4x2()
{
return new int4x2()
{
c0 = Readint4(),
c1 = Readint4()
};
}
public int4x3 Readint4x3()
{
return new int4x3()
{
c0 = Readint4(),
c1 = Readint4(),
c2 = Readint4()
};
}
public int4x4 Readint4x4()
{
return new int4x4()
{
c0 = Readint4(),
c1 = Readint4(),
c2 = Readint4(),
c3 = Readint4()
};
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 74baebf467113dd4ca83dd656a4abb67
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsInt.cs
uploadId: 866910
@@ -0,0 +1,84 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
using Unity.Mathematics.Geometry;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writequaternion(quaternion value)
{
Writefloat4(value.value);
}
public void Writerandom(Unity.Mathematics.Random random)
{
WriteUInt32(random.state);
}
public void WriteRigidTransform(RigidTransform value)
{
Writequaternion(value.rot);
Writefloat3(value.pos);
}
#if UNITYMATHEMATICS_131
public void WriteAffineTransform(AffineTransform value)
{
Writefloat3x3(value.rs);
Writefloat3(value.t);
}
#endif
#if UNITYMATHEMATICS_132
public void ReadMinMaxAABB(MinMaxAABB minMaxAABB)
{
Writefloat3(minMaxAABB.Min);
Writefloat3(minMaxAABB.Max);
}
#endif
}
public partial class Reader
{
public quaternion Readquaternion()
{
return new quaternion(Readfloat4());
}
public Random Readrandom()
{
return new Random() { state = ReadUInt32() };
}
public RigidTransform ReadRigidTransform()
{
return new RigidTransform()
{
rot = Readquaternion(),
pos = Readfloat3(),
};
}
#if UNITYMATHEMATICS_131
public AffineTransform ReadAffineTransform()
{
return new AffineTransform()
{
rs = Readfloat3x3(),
t = Readfloat3(),
};
}
#endif
#if UNITYMATHEMATICS_132
public MinMaxAABB ReadMinMaxAABB()
{
return new MinMaxAABB()
{
Min = Readfloat3(),
Max = Readfloat3()
};
}
#endif
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 34d28436e6d87044fa5dcd3b0b7fd097
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsMisc.cs
uploadId: 866910
@@ -0,0 +1,217 @@
#if UNITYMATHEMATICS
using System.Runtime.CompilerServices;
using Unity.Mathematics;
namespace FishNet.Serializing
{
public partial class Writer
{
public void Writeuint2(uint2 value)
{
WriteUInt32(value.x);
WriteUInt32(value.y);
}
public void Writeuint3(uint3 value)
{
WriteUInt32(value.x);
WriteUInt32(value.y);
WriteUInt32(value.z);
}
public void Writeuint4(uint4 value)
{
WriteUInt32(value.x);
WriteUInt32(value.y);
WriteUInt32(value.z);
WriteUInt32(value.w);
}
public void Writeuint2x2(uint2x2 value)
{
Writeuint2(value.c0);
Writeuint2(value.c1);
}
public void Writeuint2x3(uint2x3 value)
{
Writeuint2(value.c0);
Writeuint2(value.c1);
Writeuint2(value.c2);
}
public void Writeuint2x4(uint2x4 value)
{
Writeuint2(value.c0);
Writeuint2(value.c1);
Writeuint2(value.c2);
Writeuint2(value.c3);
}
public void Writeuint3x2(uint3x2 value)
{
Writeuint3(value.c0);
Writeuint3(value.c1);
}
public void Writeuint3x3(uint3x3 value)
{
Writeuint3(value.c0);
Writeuint3(value.c1);
Writeuint3(value.c2);
}
public void Writeuint3x4(uint3x4 value)
{
Writeuint3(value.c0);
Writeuint3(value.c1);
Writeuint3(value.c2);
Writeuint3(value.c3);
}
public void Writeuint4x2(uint4x2 value)
{
Writeuint4(value.c0);
Writeuint4(value.c1);
}
public void Writeuint4x3(uint4x3 value)
{
Writeuint4(value.c0);
Writeuint4(value.c1);
Writeuint4(value.c2);
}
public void Writeuint4x4(uint4x4 value)
{
Writeuint4(value.c0);
Writeuint4(value.c1);
Writeuint4(value.c2);
Writeuint4(value.c3);
}
}
public partial class Reader
{
public uint2 Readuint2()
{
return new uint2
{
x = ReadUInt32(),
y = ReadUInt32()
};
}
public uint3 Readuint3()
{
return new uint3()
{
x = ReadUInt32(),
y = ReadUInt32(),
z = ReadUInt32()
};
}
public uint4 Readuint4()
{
return new uint4()
{
x = ReadUInt32(),
y = ReadUInt32(),
z = ReadUInt32(),
w = ReadUInt32()
};
}
public uint2x2 Readuint2x2()
{
return new uint2x2()
{
c0 = Readuint2(),
c1 = Readuint2()
};
}
public uint2x3 Readuint2x3()
{
return new uint2x3()
{
c0 = Readuint2(),
c1 = Readuint2(),
c2 = Readuint2()
};
}
public uint2x4 Readuint2x4()
{
return new uint2x4()
{
c0 = Readuint2(),
c1 = Readuint2(),
c2 = Readuint2(),
c3 = Readuint2()
};
}
public uint3x2 Readuint3x2()
{
return new uint3x2()
{
c0 = Readuint3(),
c1 = Readuint3()
};
}
public uint3x3 Readuint3x3()
{
return new uint3x3()
{
c0 = Readuint3(),
c1 = Readuint3(),
c2 = Readuint3()
};
}
public uint3x4 Readuint3x4()
{
return new uint3x4()
{
c0 = Readuint3(),
c1 = Readuint3(),
c2 = Readuint3(),
c3 = Readuint3()
};
}
public uint4x2 Readuint4x2()
{
return new uint4x2()
{
c0 = Readuint4(),
c1 = Readuint4()
};
}
public uint4x3 Readuint4x3()
{
return new uint4x3()
{
c0 = Readuint4(),
c1 = Readuint4(),
c2 = Readuint4()
};
}
public uint4x4 Readuint4x4()
{
return new uint4x4()
{
c0 = Readuint4(),
c1 = Readuint4(),
c2 = Readuint4(),
c3 = Readuint4()
};
}
}
}
#endif
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 5640c6f5fc37ed3419f18024866c816c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 207815
packageName: 'FishNet: Networking Evolved'
packageVersion: 4.6.22R
assetPath: Assets/FishNet/Runtime/Serializing/UnityMathmatics/Serializers.UnityMathmaticsUInt.cs
uploadId: 866910