- Home /
Question by
MikezNesh · Jun 28, 2010 at 01:11 PM ·
destroytimergui-window
Destroy GUI-Window after 3 Seconds....
I have got a GUI-Window I want to destroy after 3 seconds...how do I do that?
I already have a timer function in the same script or other purposes....is that ok?
Thanks.
Comment
Best Answer
Answer by Mike 3 · Jun 28, 2010 at 01:15 PM
You don't really destroy windows, you just stop calling the function
Basically - set a bool to true when you want to show it, and false when you want to hide it
Then it's just a case of doing something like
if (myBool)
{
GUI.Window(stuff);
}
Edit for your timer stuff - call this function instead of setting the bool to true:
function WindowTimer()
{
myBool = true;
yield WaitForSeconds(3);
myBool = false;
}
Your answer
Follow this Question
Related Questions
Delay "Destroy(gameObject)" 2 Answers
Spawning Particle Effects From Code Does Nothing 2 Answers
Destroy happens immediately 1 Answer
Destroy trigger after a certain time 2 Answers
Hiding Texture2D after a sec 1 Answer