Hey guys. I’m trying to use GUI.BeginGroup() and GUI.EndGroup() to create ‘nodes’ for a tree editor. Im testing creating these individual areas to use the GUILayout elements at, but I seem to have the wrong idea about GUI.BeginGroup(). Can anyone set me straight? As this code suggests, the lower box is rendered first, then the upper box. But it seems that the first line in the top box is skipped, and I believe it has to do with the fact that a first line was written to in the lower box. Not sure why this is. Not sure how to fix it.
for (int index = 0; index < 2; index++) {
GUI.Box(new Rect(0, 50 + (index * -50), 50, 50), "_");
GUI.BeginGroup(new Rect(0, 50 + (index * -50), 50, 50));
GUILayout.Label(index.ToString());
GUI.EndGroup();
}