Version: 2021.3
LanguageEnglish
  • C#

ApplyRulesIfTagsNotEqualAttribute

class in UnityEditor.ShaderKeywordFilter

/

Inherits from:ShaderKeywordFilter.TagConstraintAttribute

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Enable or disable shader keyword filter attributes based on shader tags.

If you use this attribute, Unity enables filter attributes if the shader compilation context does not contain matching tags.

The following example builds only variants including the FeatureA keyword, if the shader is not a Universal Render Pipeline (URP) shader.

using UnityEditor.ShaderKeywordFilter;

[ShaderKeywordFilter.ApplyRulesIfTagsNotEqual("RenderPipeline", "UniversalPipeline")] [SelectIf(true, keywordNames: "FeatureA")] bool forceFeatureA;

Additional resources: FilterAttribute.

Constructors

ApplyRulesIfTagsNotEqualAttributeEnable or disable shader keyword filter attributes based on shader tags.

Inherited Members