Пример #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is MaterialPropertyKey))
            {
                return(false);
            }

            MaterialPropertyKey other = (MaterialPropertyKey)obj;

            return(other.ShaderName == ShaderName && other.PropertyName == PropertyName);
        }
 private static void UpdateMaterial(Dictionary <MaterialPropertyKey, MaterialPropertyAsset> materialProperties, HashSet <MaterialPropertyKey> unvisitedMaterialProperties, Material material)
 {
     if (material != null)
     {
         foreach (MaterialProperty materialProperty in MaterialEditor.GetMaterialProperties(new Material[] { material }))
         {
             var key = new MaterialPropertyKey(material.shader.name, materialProperty.name);
             unvisitedMaterialProperties.Remove(key);
             if (!materialProperties.ContainsKey(key))
             {
                 materialProperties.Add(key, new MaterialPropertyAsset
                 {
                     Shader       = material.shader,
                     propertyName = materialProperty.name,
                     propertyType = (MaterialPropertyType)materialProperty.type
                 });
             }
         }
     }
 }