- Home /
The question is answered, right answer was accepted
GUILayout.BeginHorizontal sluggish in custom inspector
I'm creating a custom inspector window where I want to render a bunch of text fields in a two column layout. I do it like this:
for (int i = 0; i < 100; ++i)
{
GUILayout.BeginHorizontal(property);
EditorGUILayout.TextField("propertyName");
EditorGUILayout.TextField("propertyValue");
GUILayout.EndHorizontal();
}
The problem is that the inspector gets very sluggish. If I remove GUILayout.BeginHorizontal the inspector performs fine. Any way around this? I need a scrollable two-column grid of text fields.
Solved it by replacing GUILayout.BeginHorizontal(property) with GUILayout.BeginHorizontal();
Follow this Question
Related Questions
Is there an event being fired off when the Inspector is being resized? 1 Answer
OnInspectorGUI - Using the default Object Selection popup. 1 Answer
Editor GUI Like mesh import animation inspector 0 Answers
Custom inspector editor - how to put new editor fields in a specific place 1 Answer
Using a CustomEditor in the inspector and also seeing normal inspector fields 1 Answer