示例#1
0
        /// <summary>
        /// Checks if UMAMaterials are effectively equal.
        /// Useful when comparing materials from asset bundles, that would otherwise say they are different to ones in the binary
        /// And procedural materials which can be output compatible even if they are generated from different sources
        /// </summary>
        /// <param name="material">The material to compare</param>
        /// <returns></returns>
        public bool Equals(UMAMaterial material)
        {
            if (this.GetInstanceID() == material.GetInstanceID())
            {
                return(true);
            }
            else
            {
                if (this.material.name != material.material.name)
                {
                    return(false);
                }
                if (this.material.shader != material.material.shader)
                {
                    return(false);
                }
                if (this.material.renderQueue != material.material.renderQueue)
                {
                    return(false);
                }
                if (this.materialType != material.materialType)
                {
                    return(false);
                }
                if (this.channels.Length != material.channels.Length)
                {
                    return(false);
                }
                for (int i = 0; i < this.channels.Length; i++)
                {
                    MaterialChannel thisChannel  = this.channels[i];
                    MaterialChannel otherChannel = material.channels[i];
                    if (thisChannel.channelType != otherChannel.channelType)
                    {
                        return(false);
                    }
                    if (thisChannel.materialPropertyName != otherChannel.materialPropertyName)
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
示例#2
0
 /// <summary>
 /// Checks if UMAMaterials are effectively equal. Useful when comparing materials from asset bundles, that would otherwise say they are different to ones in the binary
 /// </summary>
 /// <param name="material">The material to compare</param>
 /// <returns></returns>
 public bool Equals(UMAMaterial material)
 {
     if (this.GetInstanceID() == material.GetInstanceID())
     {
         return true;
     }
     else
     {
         if (this.name == material.name &&
             this.material.name == material.material.name &&
             this.materialType == material.materialType &&
             this.channels.Length == material.channels.Length)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
 }
示例#3
0
 /// <summary>
 /// Checks if UMAMaterials are effectively equal. Useful when comparing materials from asset bundles, that would otherwise say they are different to ones in the binary
 /// </summary>
 /// <param name="material">The material to compare</param>
 /// <returns></returns>
 public bool Equals(UMAMaterial material)
 {
     if (this.GetInstanceID() == material.GetInstanceID())
     {
         return(true);
     }
     else
     {
         if (this.name == material.name &&
             this.material.name == material.material.name &&
             this.materialType == material.materialType &&
             this.channels.Length == material.channels.Length)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }