MENU LOAD,PLAY AND SAVE AUTOMATICALLY THE GAME

hi to all !!!
can you helpme with an example script?

I’d like to create menu with 2 buttons GUI:
LOAD GAME(level1,lev.2 etc.) I mean ,when I press the button (LOAD GAME)it load the level where I arrived?

PLAY GAME (from the beginning “level1”).

and I’d like to create script that save automatically the ultimate level where I arrived so when I am on MENU (LOAD GAME,PLAY GAME) of iphone and press the button “LOAD GAME” it must load the level where I was playing .
do you have an example script or tutorial ?

thanks lot!

ciao scinfu,

best to post this on the iPhone forum.

It is not possible at the moment (waiting for the hotfix) to save data to the iPhone using PlayerPrefs but there is a workaround here;

http://forum.unity3d.com/viewtopic.php?t=15196

You will need to save off the level the player is currently playing but as the player can quit at anytime (press home button) you will need to save this when they choose the level.

if (GUI.Button (new Rect (40,110,42,32),"Level 1"))
		{
                        //write to the data file then load the level
			Application.LoadLevel("Level 1");
		}