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++; } }); }
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; } }
public override bool Equals(object obj) { if (obj is SCKeyword) { SCKeyword other = (SCKeyword)obj; return(name.Equals(other.name)); } return(false); }
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)); }