diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/Byte4.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/Byte4.cs index 7df1446b6..57dff1c06 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/Byte4.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/Byte4.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; namespace UniGLTF { [Serializable, StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct Byte4 + public readonly struct Byte4 : IEquatable { 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; + } } } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/UShort4.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/UShort4.cs index d13c87c93..3dcee0c1e 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/UShort4.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/UShort4.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; namespace UniGLTF { [Serializable, StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct UShort4 + public readonly struct UShort4 : IEquatable { 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; + } } }