Making labels appear after button is clicked

Hi, I’d like to make label appear when a person makes a choice by clicking on a button.

    if (GUI.Button (new Rect (165, 200, 75, 30), "Dwarf")) {
            GUI.Label(new Rect (425, 75, 325, 150),"You are a Dwarf.");
            GUI.Label(new Rect(425, 125, 575, 190), "As a Dwarf you are hardy, +1 Endurance.");
        }

I tried this, but the labels didn’t show up at all.

    if (GUI.RepeatButton (new Rect (165, 200, 75, 30), "Dwarf")) {
            GUI.color = Color.black;
            GUI.Label(new Rect (425, 75, 325, 150),"You are a Dwarf.");
            GUI.Label(new Rect(425, 125, 575, 190), "As a Dwarf you are hardy, +1 Endurance.");
        }

So then I tried this, the labels were appearing, but they were appearing white, so I threw in a color change.

Now the labels only appear if I click AND HOLD, the button, also, the buttons that follow after are all recoloured to black, when I want them to be white.

I’d like to know the code for making it work, I’m not interested in “use GUIStyle” responses, thanks.

If you’re switching between different races, set an integer to a value corresponding to an enum for the race. Then use a switch to determine which labels to show.

I have no idea what an enum looks like, I tried making one based off of this http://msdn.microsoft.com/en-us/library/sbbt4032.aspx and it just says “parser error unexpected symbol 'enum”

        enum raceChoice : int {0, 1, 2, 3, 4, 5, 6 };

Learning as I go, so you’ll need to treat me like I know nothing, because I pretty much don’t. I thought I knew how to do a switch, turns out I don’t. Despite putting in the code for it, nothing showed when I clicked the button.

If you have this defined outside your methods:

enum Race
{
    Undecided=0,
    Dwarf,
    Elf,
    Human,
    Werepants
};

then you could have code somewhat like this for showing the buttons:

int race = 0;
if(GUI.Button (new Rect (165, 200, 75, 30), "Dwarf")) race = Race.Dwarf;
if(GUI.Button (new Rect (165, 240, 75, 30), "Elf")) race = Race.Elf;

etc. And in the next section following you display the label:

switch(race)
{
    case Race.Dwarf:
        // Display label here
        break;
    case Race.Elf:
        // Fill in code for the other races here. break after each.
    default:
        break;
}

I’m assuming all the buttons are in different position, and that there is one location for labels. The label display code could simply set a couple of strings, and you could then do just one label for each string after the switch block. I find this code cleaner, anyway, and it might be easier to convert to other GUI systems.