Hey all,
I am trying to use EditorGUILayout.BeginHorizontal() in order to get a rect for the row so I can do some things I can’t do without the rect (such as flush right buttons). The problem I am having though is that that rect returned from this has no height, so if I use it, the row essentially doesn’t flow properly in the overall layout.
Rect rowRect = EditorGUILayout.BeginHorizontal(GUILayout.Height(EditorGUIUtility.singleLineHeight));
You need to have some gui between BeginHorizontal/EndHorizontal.
Rect rowRect = EditorGUILayout.BeginHorizontal(GUILayout.Height(EditorGUIUtility.singleLineHeight));
GUILayout.Label("Text");
EditorGUILayout.EndHorizonta();
If you just want to get a rect, you should use EditorGUILayout.GetControlRect().
Well what I want to do is get the rect of what the row would be so I can draw multiple controls in that row, some of them I want to be aligned right not left hence why I wanted to do the drawing myself.
I had some GUI between them, but that gui was drawn using the rect not Layout so I guess I can see what you mean there.
I managed to get what I wanted though using flexible spacers.