2020.3.11f1
From a PropertyDrawer, how do I get the horizontal spacing between property labels and fields in the inspector?
![alt text][1]
The controls in the above image were drawn with:
public override void OnGUI (Rect pos, SerializedProperty property, GUIContent label) {
EditorGUI.BeginProperty(pos, label, property);
EditorGUI.DrawRect(new Rect(pos.x, pos.y, EditorGUIUtility.labelWidth, EditorGUIUtility.singleLineHeight), Color.blue);
EditorGUI.TextField(pos, new GUIContent(" "), "");
EditorGUI.EndProperty();
}
Thanks.
[1]: https://forum.unity.com/attachments/upload_2021-6-13_20-32-40-png.870944/
↧