From aed1d170d403f90497a72eae568cd62d36fc214d Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Mon, 5 Dec 2022 16:05:20 +0900 Subject: [PATCH] make MaterialDescriptor class --- .../Material/Importer/MaterialDescriptor.cs | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialDescriptor.cs b/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialDescriptor.cs index b46f09bcd..41e61e9ec 100644 --- a/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialDescriptor.cs +++ b/Assets/VRMShaders/GLTF/IO/Runtime/Material/Importer/MaterialDescriptor.cs @@ -4,7 +4,7 @@ using UnityEngine; namespace VRMShaders { - public readonly struct MaterialDescriptor : IEquatable + public sealed class MaterialDescriptor { public readonly string Name; public readonly string ShaderName; @@ -43,31 +43,5 @@ namespace VRMShaders Vectors = vectors; Actions = actions; } - - public bool Equals(MaterialDescriptor other) - { - return Name == other.Name && ShaderName == other.ShaderName && RenderQueue == other.RenderQueue && Equals(TextureSlots, other.TextureSlots) && Equals(FloatValues, other.FloatValues) && Equals(Colors, other.Colors) && Equals(Vectors, other.Vectors) && Equals(Actions, other.Actions); - } - - public override bool Equals(object obj) - { - return obj is MaterialDescriptor other && Equals(other); - } - - public override int GetHashCode() - { - unchecked - { - var hashCode = (Name != null ? Name.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (ShaderName != null ? ShaderName.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ RenderQueue.GetHashCode(); - hashCode = (hashCode * 397) ^ (TextureSlots != null ? TextureSlots.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (FloatValues != null ? FloatValues.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (Colors != null ? Colors.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (Vectors != null ? Vectors.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (Actions != null ? Actions.GetHashCode() : 0); - return hashCode; - } - } } } \ No newline at end of file