internal static Rect DrawPanel(WindowPanel panel) { Rect drawRect = new Rect(panel.window.position.width - panel.width - 5f, currentY, panel.width, panel.height); Color prevColor = GUI.backgroundColor; GUI.backgroundColor = DreamteckEditorGUI.lightColor; GUI.Box(drawRect, panel.title, defaultBoxStyle); currentY += drawRect.height; drawRect.y += 22; drawRect.height -= 22; drawRect.x += 5; drawRect.width -= 10; GUILayout.BeginArea(drawRect); panel.uiFunction(); GUILayout.EndArea(); GUI.backgroundColor = prevColor; return(drawRect); }