private void DrawSegments() { showSegments = EditorToolkit.DrawTitleFoldOut(showSegments, "Segments"); if (showSegments) { EditorGUI.indentLevel++; if (group.segments.Count > 0) { for (int i = 0; i < group.segments.Count; i++) { EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); group.segments[i].name = EditorGUILayout.TextField(group.segments[i].name); if (GUILayout.Button("X", EditorToolkit.CloseButtonLayoutOption())) { group.segments.RemoveAt(i); return; } EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel++; group.segments[i].start = EditorGUILayout.Vector3Field("Start", group.segments[i].start); if (group.segments.Count - 1 == i && !group.isClosed) { group.segments[i].end = EditorGUILayout.Vector3Field("End", group.segments[i].end); } EditorGUI.indentLevel--; EditorGUILayout.Separator(); EditorGUI.indentLevel--; } } else { EditorGUILayout.HelpBox("No segments. Click Add Segment in the toolbar or use the SceneView click-to-create method.", MessageType.Info); } EditorGUI.indentLevel--; EditorToolkit.DrawSeparator(); } }
private void DrawSettings() { showHeader = EditorToolkit.DrawTitleFoldOut(showHeader, "Settings"); if (showHeader) { EditorGUI.indentLevel++; group.gameObject.name = EditorGUILayout.TextField("Name", group.name); group.color = EditorGUILayout.ColorField("Color", group.color); group.layer = EditorGUILayout.LayerField("Layers", group.layer); group.isClosed = EditorGUILayout.Toggle("Is Closed", group.isClosed); forceUpdate.boolValue = EditorGUILayout.Toggle("Force Editor Update", forceUpdate.boolValue); group.height = EditorGUILayout.FloatField("Height", group.height); group.depthAnchor = (DepthAnchorTypes)EditorGUILayout.EnumPopup("Depth Anchor", (Enum)group.depthAnchor); group.depth = EditorGUILayout.FloatField("Depth", group.depth); EditorGUI.indentLevel--; } }
private void DrawOperations() { showOps = EditorToolkit.DrawTitleFoldOut(showOps, "Operations"); if (showOps) { EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Mass Apply", GUILayout.MinWidth(80f)); massApplyPart = EditorGUILayout.Popup(massApplyPart, new[] { "None", "X", "Y", "Z" }, GUILayout.MinWidth(60f)); massApplyValue = EditorGUILayout.FloatField(massApplyValue, GUILayout.MinWidth(50f)); if (GUILayout.Button("Go", EditorToolkit.GoButtonLayoutOption())) { MassApply(massApplyPart, massApplyValue); } EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel--; } }