- Home /
Pause button Help (need it to disappear after use)
I have a clickable pause button that i'm using a gui texture, and putting all my scripts in. what is happening is i click on it and my pause menu come up but i cant get it to disappear from my screen. what i would like is a touch of a finger and touch of a mouse i don't know if that possible if you could help me i would appreciate it!
--First script--
var guiSkin: GUISkin;
var PB : boolean;
function Update()
{
if(PB != PButton.PButtons)
{
PB = PButton.PButtons;
}
if(PB == true)
{
Time.timeScale = 0.0;
}
if(PB == false)
{
Time.timeScale = 1.0;
}
}
function OnGUI ()
{
// we need to draw up a gui for the pause botton a box of some sort and a better
//quit and continue botton.
GUI.skin = guiSkin;
if(PB == true)
{
if(GUI.Button (Rect(Screen.width/1.6-Screen.width/15,Screen.height/2-50,Screen.width/8,Screen.height/8), "Quit"))
{
Application.Quit();
}
if(GUI.Button (Rect(Screen.width/3.1-Screen.width/65,Screen.height/2-50,Screen.width/8,Screen.height/8), "Continue"))
{
Time.timeScale = 1.0;
PB = false;
}
if(GUI.Button (Rect(Screen.width/2-Screen.width/15,Screen.height/2-50,Screen.width/8,Screen.height/8), "Choose Level"))
{
Time.timeScale = 1.0;
PB = false;
}
}
}
--Second script--
#pragma strict
static var PButtons: boolean;
function OnMouseDown()
{
PButtons = true;
}
Comment
i would like it to dissapear after i click on the continue button.
Best Answer
Answer by FrankStarsKo · Sep 12, 2013 at 07:20 AM
you just asked this same question twice, did you try the answer i gave you?
http://answers.unity3d.com/questions/534929/pause-button-help.html