How can I make a continue button with the following scripts
Hello I have the question how I can make a continue button that fits in the following script the button needs to be a button when you left a game and then come back again you go to the level were you left and I already created a button so i want that the script fits with the button. These are the scripts were its going about.
public Canvas quitMenu;
public Button startText;
public Button exitText;
// Use this for initialization
void Start () {
quitMenu = quitMenu.GetComponent<Canvas> ();
startText = startText.GetComponent<Button> ();
exitText = exitText.GetComponent<Button> ();
quitMenu.enabled = false;
}
public void ExitPress()
{
quitMenu.enabled = true;
startText.enabled = false;
exitText.enabled = false;
}
public void NoPress()
{
quitMenu.enabled = false;
startText.enabled = true;
exitText.enabled = true;
}
public void StartLevel()
{
Application.LoadLevel (1);
}
public void ExitGame()
{
Application.Quit ();
}
}
and this script
public static int currentLevel = 1;
void Start ()
{
if (PlayerPrefs.GetInt ("Level Completed") > 0) {
currentLevel = PlayerPrefs.GetInt ("Level Completed");
} else {
currentLevel = 0;
}
}
public static void CompleteLevel()
{
currentLevel += 1;
PlayerPrefs.SetInt ("Level Completed", currentLevel);
PlayerPrefs.GetInt ("Level completed");
Application.LoadLevel(currentLevel);
}
}
I hope you can help. Thanks a lot
Comment
@Ties,did u find a answer.If yes pls tell me I have the same trouble