0
,所以我想格式化定制EditorWindow
我的工作和我的水平布局安排一切,让元素很好地适应像表行。EditorGUILayout.BeginHorizontal()返回一个空矩形
不幸的是,我的标题行已关闭,所以我试图通过从EditorGUILayout.BeginHorizontal()
方法获得基地Rect
来统一所有内容。
不幸的是,它返回默认值Rect
(一切都是0
)。所以我无法正确使用它。我缺少的东西,或为什么它返回一个空Rect
?在EditorWindow
本身,空间已满。
示例代码:
Rect boundary = EditorGUILayout.BeginHorizontal();
float largeWidth = boundary.width * 0.4f;
float smallWidth = boundary.width * 0.2f;
EditorGUILayout.LabelField("stuff1", GUILayout.Width(largeWidth));
EditorGUILayout.LabelField("stuff2", GUILayout.Width(largeWidth));
EditorGUILayout.LabelField("stuff3", GUILayout.Width(smallwidth));
EditorGUILayout.EndHorizontal();