private void DrawToolGui() { areToolsFoldedOut = EditorGUILayout.Foldout(areToolsFoldedOut, new GUIContent("Tools", toolsIcons), foldoutStyle); if (areToolsFoldedOut) { GUILayout.BeginHorizontal(); { GUILayout.Label("Brush:", GUILayout.MaxWidth(40), GUILayout.Height(20)); ToolSelection currentToolSelection = sceneManipulator.GetCurrentTool(); PaintingBrush currentBrushSize = sceneManipulator.GetCurrentBrush(); Texture[] brushIcons = new Texture[] { preciseBrushIcon, smallBrushIcon, mediumBrushIcon, largeBrushIcon }; int brushId = (currentToolSelection == ToolSelection.TrianglePainting) ? (int)currentBrushSize : -1; int newBrushId = GUILayout.Toolbar(brushId, brushIcons, UnityEditor.EditorStyles.miniButton, GUILayout.Width(120), GUILayout.Height(20)); int pipetteId = (currentToolSelection == ToolSelection.Pipette ? 0 : -1); int newPipetteId = GUILayout.Toolbar(pipetteId, new Texture[] { currentToolSelection == ToolSelection.Pipette ? pipetteIcon : pipetteIcon }, UnityEditor.EditorStyles.miniButton, GUILayout.Height(20), GUILayout.Width(30)); if (newBrushId != brushId) { sceneManipulator.SetTool(ToolSelection.TrianglePainting); sceneManipulator.SetBrush((PaintingBrush)newBrushId); } else if (newPipetteId != pipetteId) { sceneManipulator.SetTool(newPipetteId == 0 ? ToolSelection.Pipette : ToolSelection.TrianglePainting); } if (GUILayout.Button(new GUIContent("Generate"), GUILayout.MinWidth(10))) { GenerateColliders(); } if (GUILayout.Button(new GUIContent("Delete Colliders", deleteIcon), GUILayout.MinWidth(10))) { DeleteColliders(); } if (GUILayout.Button(new GUIContent("Delete generated", deleteIcon), GUILayout.MinWidth(10))) { DeleteGenerated(); } } GUILayout.EndHorizontal(); } // end foldout DrawUiDivider(); }
public void SetBrush(PaintingBrush brush) { this.currentBrushSize = brush; }