- Home /
AttributeDrawer: Draw parent property? (the one [AttributeName] is attached to)
The presets
property has a custom attribute attached to it and is an array of a custom serializable class. in an attribute drawer class, the property and position passed in the OnGUI() parameters are for each child inside presets
. I'm trying to attach the "+" button to the bottom of the presets
property though to allow the extra space it needs.
right now, I'm attaching it to the last property. If I try to override the GetPropertyHeight() with extra space, it applies to all of these properties and that's not what I want.
I'm also currently getting the "presets" property with
properties = property.serializedObject.FindProperty(property.propertyPath.Remove(
property.propertyPath.Length - (".Array.data[".Length + 2)));
and I tried to set the height like this:
Rect mainRect = properties.rectValue;
mainRect.height += 20;
EditorGUI.PropertyField(properties.rectValue, properties);
but I get
InvalidOperationException: The operation is not possible when moved past all properties (Next returned false)
I really would prefer not to write a custom editor script for the Example class.
http://answers.unity3d.com/questions/1364895/custom-property-drawer-overlaps-with-other-compone.html
I also checked this out, but they're trying to fix spacing within the properties themselves, not the parent property.
Your answer
![](https://koobas.hobune.stream/wayback/20220612133151im_/https://answers.unity.com/themes/thub/images/avi.jpg)