show pause menu issues

if (Input.GetButtonUp(“Fire1”)) {
AudioListener.pause = true;
if(!paused) {
//GUI.Box(new Rect(0,0,Screen.width,Screen.height),“”);
Time.timeScale = 0;
paused = true;
}
else {
Time.timeScale = 1;
paused = false;
AudioListener.pause = false;
}
}

I cannot instantiate a new GUI.Box inside Update(). But if I put that code in OnGUI, it doesn’t work(not run every frame). How can I make a menu show up? I was thinking of Event listeners, but is there something more intuitive?

Why not have both functions?

function Update (){
//Check for input and set paused to true and what not.
}

function OnGUI{
    //Check if paused is true
    if(paused){
    //Draw GUI
    }
}

Use Update to check for input and OnGUI to draw GUIs.