Class HideIfAttributeDrawer
Custom property drawer for HideIfAttribute.
[CustomPropertyDrawer(typeof(HideIfAttribute))]
public class HideIfAttributeDrawer : ShowIfAttributeDrawer
Inheritance
Inherited Members
- ShowIfAttributeDrawer.CreatePropertyGUI(SerializedProperty)
- ShowIfAttributeDrawer.UpdateState(SerializedProperty, VisualElement)
- ShowIfAttributeDrawer.OnGUI(Rect, SerializedProperty, GUIContent)
- EnableIfAttributeDrawer.CreatePropertyGUI(SerializedProperty)
- EnableIfAttributeDrawer.UpdateState(SerializedProperty, VisualElement)
- EnableIfAttributeDrawer.GetCurrentState(SerializedProperty, EnableIfAttribute)
- EnableIfAttributeDrawer.OnGUI(Rect, SerializedProperty, GUIContent)
Methods
CreatePropertyGUI(SerializedProperty)
Creates the VisualElement-based UI for the property.
public override VisualElement CreatePropertyGUI(SerializedProperty property)
Parameters
| Name | Type | Description |
|---|---|---|
property | SerializedProperty | Serialized property being drawn. |
Returns
VisualElement — The element containing the custom GUI.
GetCurrentState(SerializedProperty, EnableIfAttribute)
Evaluates the condition state to determine how should the property be handled.
protected override bool GetCurrentState(SerializedProperty property, EnableIfAttribute ifAttribute)
Parameters
| Name | Type | Description |
|---|---|---|
property | SerializedProperty | The condition property's serialized data. |
ifAttribute | EnableIfAttribute | The EnableIfAttribute instance containing condition metadata. |
Returns
bool — The current state.
OnGUI(Rect, SerializedProperty, GUIContent)
Draws the IMGUI-based field in the Inspector.
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Parameters
| Name | Type | Description |
|---|---|---|
position | Rect | The rectangle on screen to use for the property field. |
property | SerializedProperty | The property to draw. |
label | GUIContent | Label to display beside the property. |