Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts.

However for some reason it prints each button twice to the screen, once with my custom style, and once without.

this is the code I have used:

if(menu){


if (GUI.Button(Rect(Screen.width/2 - 50, Screen.height/2, 100, 30), "Start Game", customGuiStyle)){

Application.LoadLevel ("Level 1");
}


if (GUI.Button(Rect(Screen.width/2 - 50, Screen.height/2 + 30, 100, 30), "Options", customGuiStyle)){


menu = false;
options = true;
}


if (GUI.Button(Rect(Screen.width/2 - 50, Screen.height/2 + 90, 100, 30), "Quit", customGuiStyle)){


Application.Quit();
}
}

I have no idea why it is showing two texts, heres a screen shot of exactly what I mean...enter image description here

share|improve this question
    
Add more information about where it is placed OnGUI? Update? What have you tried and with what results? – Johan Holtby Feb 16 '15 at 21:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.