Exemplo n.º 1
0
        void UpdateKeywords()
        {
            passes.ForEach((SCShaderPass pass) => {
                for (int l = 0; l < pass.keywordLines.Count; l++)
                {
                    SCKeywordLine line = pass.keywordLines[l];
                    for (int k = 0; k < line.keywords.Count; k++)
                    {
                        SCKeyword keyword = line.keywords[k];
                        if (!keywords.Contains(keyword))
                        {
                            if (SCKeywordChecker.IsValid(keyword.name))
                            {
                                keywords.Add(keyword);
                            }
                        }
                    }
                }
            });

            enabledKeywordCount = 0;
            keywords.ForEach((SCKeyword kw) => {
                if (kw.enabled)
                {
                    enabledKeywordCount++;
                }
            });
        }
Exemplo n.º 2
0
        public void Add(SCKeyword keyword)
        {
            if (GetKeyword(keyword.name) != null)
            {
                return;
            }
            // ignore underscore keywords
            bool goodKeyword = false;

            for (int k = 0; k < keyword.name.Length; k++)
            {
                if (keyword.name[k] != '_')
                {
                    goodKeyword = true;
                    break;
                }
            }
            if (goodKeyword)
            {
                keywords.Add(keyword);
            }
            else
            {
                keyword.isUnderscoreKeyword = true;
                hasUnderscoreVariant        = true;
            }
        }
Exemplo n.º 3
0
 public override bool Equals(object obj)
 {
     if (obj is SCKeyword)
     {
         SCKeyword other = (SCKeyword)obj;
         return(name.Equals(other.name));
     }
     return(false);
 }
Exemplo n.º 4
0
        public SCKeyword GetKeyword(string name)
        {
            int kCount = keywords.Count;

            for (int k = 0; k < kCount; k++)
            {
                SCKeyword keyword = keywords[k];
                if (keyword.name.Equals(name))
                {
                    return(keyword);
                }
            }
            return(new SCKeyword(name));
        }