예제 #1
0
        internal Material method_0(Material material_0, int int_0, ShaderKeywords shaderKeywords_0)
        {
            Struct6  struct2;
            Material material;

            struct2.int_0            = material_0.GetInstanceID();
            struct2.int_1            = int_0;
            struct2.shaderKeywords_0 = shaderKeywords_0;
            if (this.dictionary_0.TryGetValue(struct2, out material))
            {
                if (material != null)
                {
                    return(material);
                }
                this.dictionary_0.Remove(struct2);
            }
            material = new Material(material_0)
            {
                hideFlags = HideFlags.DontSave
            };
            if (int_0 != -1)
            {
                material.renderQueue = int_0;
            }
            IEnumerator <int> enumerator = struct2.shaderKeywords_0.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    int    current     = enumerator.Current;
                    string keywordName = ShaderKeywords.GetKeywordName(current);
                    material.EnableKeyword(keywordName);
                    material.name = material.name + "[" + keywordName + "]";
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            this.dictionary_0.Add(struct2, material);
            return(material);
        }
예제 #2
0
 public bool Equals(ShaderKeywords other)
 {
     return(this.keywords == other.keywords);
 }
예제 #3
0
 public void Merge(ShaderKeywords keywords)
 {
     this.keywords |= keywords.keywords;
 }