void DrawNewAreaGUI() { EditorGUILayout.BeginVertical("Button"); EditorGUI.indentLevel++; showCreateNew.boolValue = EditorGUILayout.Foldout(showCreateNew.boolValue, "Create New Area"); EditorGUI.indentLevel--; if (showCreateNew.boolValue) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Name", GUILayout.MaxWidth(50)); newAreaName = EditorGUILayout.TextField("", newAreaName, GUILayout.MaxWidth(120)); newColor = EditorGUILayout.ColorField((""), newColor, GUILayout.MaxWidth(60)); EditorGUILayout.EndHorizontal(); if (GUILayout.Button("Create Area")) { SS_Common.SS_CreateLevelArea(TheTarget.gameObject, newAreaName, newColor); newAreaName = ""; } } EditorGUILayout.EndVertical(); }