readonly struct Byte4 and UShort4.

This commit is contained in:
ousttrue 2021-10-26 19:31:16 +09:00
parent 1e2166eb10
commit ddcb5af0e3
2 changed files with 12 additions and 2 deletions

View File

@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace UniGLTF
{
[Serializable, StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Byte4
public readonly struct Byte4 : IEquatable<Byte4>
{
public readonly byte x;
public readonly byte y;
@ -17,5 +17,10 @@ namespace UniGLTF
z = _z;
w = _w;
}
public bool Equals(Byte4 other)
{
return x == other.x && y == other.y && z == other.z && w == other.w;
}
}
}

View File

@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace UniGLTF
{
[Serializable, StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct UShort4
public readonly struct UShort4 : IEquatable<UShort4>
{
public readonly ushort x;
public readonly ushort y;
@ -18,5 +18,10 @@ namespace UniGLTF
z = _z;
w = _w;
}
public bool Equals(UShort4 other)
{
return x == other.x && y == other.y && z == other.z && w == other.w;
}
}
}