Okay, I have a menu that has three buttons. Play, Controls, and About. When you click on Play, you come to another menu. There are three buttons on that. Resume, New Game, and Back. Here’s the code:
function OnGUI () {
if (GUI.Button (Rect (175,75,120,40), "Resume")) {
Application.LoadLevel (3);
print (PlayerPrefs.GetInt("Player Level"));
}
if (GUI.Button (Rect (175,150,120,40), "New Game")) {
Application.LoadLevel (4);
PlayerPrefs.SetInt("Player Level", 1);
}
if (GUI.Button (Rect (175,225,120,40), "BACK")) {
Application.LoadLevel (0);
}
}
Okay, so when I click on new game, I got PlayerPrefs to save the fact that the player was on level 1. However, when I click on Resume, it just returns the number 1. How to I get that to redirect the player to Level1?
(code would be VERY helpful)