Skip to main content

Class DisableIfAttribute

Attribute used to disable a field in the Unity Inspector based on one or more conditional boolean properties.

public class DisableIfAttribute : EnableIfAttribute

Inheritance​

Inherited Members​

Constructors​

DisableIfAttribute(string, int)​

Disables the property if the specified condition returns true.

public DisableIfAttribute(string conditionName, int order = 0)

Parameters​

NameTypeDescription
conditionNamestringName of the boolean property or method that determines the disabled state.
orderintDraw order for the property.

DisableIfAttribute(EConditionOperator, int, params string[])​

Disables the property based on a combination of multiple boolean conditions.

public DisableIfAttribute(EConditionOperator operatorType, int order = 0, params string[] conditionNames)

Parameters​

NameTypeDescription
operatorTypeEConditionOperatorLogical operator to combine the conditions: And or Or.
orderintDraw order for the property.
conditionNamesstring[]Names of the conditions used to determine the disabled state.
  • Constructors
    • DisableIfAttribute(string, int)
    • DisableIfAttribute(EConditionOperator, int, params string[])