Hi guys, I’m getting an error when attempting to write a custom PropertyDrawer. This class itself is then exposed to the editor within a MonoBehaviour in an array of that Serializeable class.
So, the class is marked serializable and I do have a property class that is suppose to define the logic for this. However, the result I get is this
The fields appear to bleed out of the defined component space for some reason. This may have something to do with them being an array but I cannot find any information that solves this issue and very little that even mentions it.
Hope someone who has had this issue, and solved it, can enlighten me.
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.PropertyField(position, property.FindPropertyRelative("_SwapTo"));
float newPropertyHeight = position.top + this.GetPropertyHeight(property.FindPropertyRelative("_ColorReference"), GUIContent.none);
EditorGUI.PropertyField(new Rect(position.left, newPropertyHeight, position.width, position.height), property.FindPropertyRelative("_ColorReference"));
}