Example #1
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        HideWhenFalse      hiddenAttribute = attribute as HideWhenFalse;
        SerializedProperty boolProperty    = property.serializedObject.FindProperty(hiddenAttribute.hideBoolean);

        if (boolProperty.boolValue)
        {
            EditorGUI.PropertyField(position, property, label, true);
        }
    }
Example #2
0
    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    {
        HideWhenFalse      hiddenAttribute = attribute as HideWhenFalse;
        SerializedProperty boolProperty    = property.serializedObject.FindProperty(hiddenAttribute.hideBoolean);

        if (!boolProperty.boolValue)
        {
            return(0f);
        }

        return(EditorGUI.GetPropertyHeight(property));
    }