How to detect from which button the scene is loaded?

for example if we have:
void OnMouseDown(){
if(this.name == “continue”){
LoadLevel(“level2”);
}

if(this.name == “continue-prev-game”){
LoadLevel(“level2”);

}
}

Now here are two buttons, continue and continue-prev-button. i want to know how can i detect (when i reach level 2), from which button i reached at Level 2. continue or continue-prev-game.

Use a dontDestroyOnLoad to “carry” data between scenes (lots of info on how to make one. They are a bit tricky.) Could also probably use a static variable.

Suppose you call it sceneData. button1 can set sceneData.buttonPressed=1; before running LoadLevel(2). In the main Start() or Awake) of level 2, read sceneData.buttonPressed and do what it says.