save game by user

if i have four scene if the player quit the game after second scene and save it .when the player start the game again how to load from second scene as we do in normal game

I'm assuming that you load the second scene by reference:


If so, you need to store the present scene number and load that scene by default. Something like:

var presentScene; // the variable for your scene

function OnStart(){

    presentScene = GetSceneFromData() // Restore the scene number from whatever data function you use to store it
    // Continue loading your data to re-set up here...


function SaveScene(){
    // Use whatever output function you want to save the scene number...
function GetSceneFromData(){
    // Get the data from where you originally saved it...

I don't know what output structure you are using, so this is general and just off the top of my head.

you can create a button in GUI, writing: "Save and Exit"when the player presses the button you save the variable CurrentLevel, according to the level he is, so that you can use PlayerPrefs, look in your documentation about that In the script to create a Start function that sets a variable CurrentLevel.