- Home /
Pause Button Help
my pause button apears and comes on my screen but my continue button wont work witch is what i'm trying to get working. if i could get your help i would be very greatful. I am using a boolean i'm not sure if i should be using this if not please tell me here is my 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
tatic var PButtons: boolean;
function OnMouseDown() { PButtons = true; }
Answer by FrankStarsKo · Sep 12, 2013 at 12:25 AM
on button continue place this:
Time.timeScale = 1.0;
PB = false;
PButton.PButtons = false; // add this line
if that doesn't do the job, just copy and paste your script well organized.
hope that helps.
Answer by magnusOP · Sep 11, 2013 at 04:51 PM
i forgot to mention that this is a touch button, i have it set up in the top right corner. once i have pressed the button with my mouse it stays on my screen and i cannot unpause it with continue. thanks again