Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether the specified <see cref="MaterialPalette"/> is equal to the current <see cref="UFLT.Records.MaterialPalette"/>.
        /// </summary>
        /// <param name='other'>
        /// The <see cref="MaterialPalette"/> to compare with the current <see cref="UFLT.Records.MaterialPalette"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="MaterialPalette"/> is equal to the current
        /// <see cref="UFLT.Records.MaterialPalette"/>; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(MaterialPalette other)
        {
            // Check color fields
            if (!Ambient.Equals(other.Ambient))
            {
                return(false);
            }
            if (!Diffuse.Equals(other.Diffuse))
            {
                return(false);
            }
            if (!Specular.Equals(other.Specular))
            {
                return(false);
            }
            if (!Emissive.Equals(other.Emissive))
            {
                return(false);
            }

            if (Mathf.Approximately(Shininess, other.Shininess))
            {
                return(false);
            }
            if (Mathf.Approximately(Alpha, other.Alpha))
            {
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// Test to see if this material is equal to another.
 /// </summary>
 /// <param name="other">The material to test against.</param>
 /// <returns>True if the object is equal to this one. False, otherwise.</returns>
 public bool Equals(MeshStandardMaterial other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Roughness.Equals(other.Roughness) &&
            Metalness.Equals(other.Metalness) &&
            Ambient.Equals(other.Ambient) &&
            Color.Equals(other.Color) &&
            Emissive.Equals(other.Emissive) &&
            Map == other.Map &&
            BumpMap == other.BumpMap &&
            AlphaMap == other.AlphaMap &&
            EnvironmentMap == other.EnvironmentMap);
 }