UnityEditor.MaterialToggleDrawer.SetKeywordInternal C# (CSharp) Méthode

SetKeywordInternal() protected méthode

protected SetKeywordInternal ( MaterialProperty prop, bool on, string defaultKeywordSuffix ) : void
prop MaterialProperty
on bool
defaultKeywordSuffix string
Résultat void
        protected void SetKeywordInternal(MaterialProperty prop, bool on, string defaultKeywordSuffix)
        {
            string keyword = !string.IsNullOrEmpty(this.keyword) ? this.keyword : (prop.name.ToUpperInvariant() + defaultKeywordSuffix);
            foreach (Material material in prop.targets)
            {
                if (on)
                {
                    material.EnableKeyword(keyword);
                }
                else
                {
                    material.DisableKeyword(keyword);
                }
            }
        }
    }