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
- EnableIfAttribute.ConditionNames
- EnableIfAttribute.Operator
- EnableIfAttribute.GetCondition(SerializedProperty)
Constructors
DisableIfAttribute(string, int)
Disables the property if the specified condition returns true.
public DisableIfAttribute(string conditionName, int order = 0)
Parameters
| Name | Type | Description |
|---|---|---|
conditionName | string | Name of the boolean property or method that determines the disabled state. |
order | int | Draw 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
| Name | Type | Description |
|---|---|---|
operatorType | EConditionOperator | Logical operator to combine the conditions: And or Or. |
order | int | Draw order for the property. |
conditionNames | string[] | Names of the conditions used to determine the disabled state. |