So basically im trying to have options apear upon a certain time, well i can get the box to appear, and the buttons to appear, but when i do the box and buttons the box doesnt appear and only the buttons do. Anyone have any idea?
My current simplified method fttb.
public void OnGUI(){
if (screenon){
if (vec != null){
GUI.skin = optionskin;
Rect rec = new Rect(vec.x,Screen.height-vec.y,75,150);
if (Options[0] != null){
if (GUI.Button(new Rect(vec.x,(Screen.height-vec.y)+25,75,35), Options[0])){
}
}
}
}
}
1.make sure optionskin is defined.
2.check to see if notch shaved his beard yet.
3.get past this check list.
you could always create a gui box in code, as it’s weird I don’t see your gui box defined in code only the button as you claim you need the box to dissapear with the button and re-appear. so it’s simple you could use a boolean for when the boolean is true ongui then show box w/button inside.
it’s actually fairly easy to understand, if you need more assistance please let me know!
public bool boxappear = false;
void OnGUI () {
if(boxappear == true){
// Make a background box
GUI.Box(new Rect(10,10,100,90), "Loader Menu");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if(GUI.Button(new Rect(20,40,80,20), "Level 1")) {
Application.LoadLevel(1);
}
// Make the second button.
if(GUI.Button(new Rect(20,70,80,20), "Level 2")) {
Application.LoadLevel(2);
}
}
}