I Added Color to the buttons!

// Change the color between the GUILayout-horizontal area, so only the buttons are affected
Color defaultGUIColor = GUI.backgroundColor; // Saves the default color

GUI.backgroundColor = Color.red; // Set the color for Delete-button
if (GUILayout.Button("x"))
    deletingNode = node;

GUI.backgroundColor = Color.green; // Set the color for the Add-button
if (GUILayout.Button("+"))
    creatingNode = node;
GUI.backgroundColor = defaultGUIColor; // Sets the default color back

I found it pretty difficult to discern between the + and x and I did try to change the labels to say for example “Remove” and “Remove this” and “Add” and “Add child” but I just didn’t like the look of those, so decided to do this instead! :slight_smile:


Nice job! This is good to know.

1 Like

This is a neat idea, thanks!

Privacy & Terms