How to load level then set variable in that level?

Hi, I want to load a scene, then set a variable in that scene (Like this)

Application.LoadLevel(Application.loadedLevel);
cc.hasStarted = true;

This is so the game starts right away when the scene is loaded, but it doesn’t work. Is there another way to do this?

make cc static bool
(if you are using it from instance)

 cc.hasStarted = true; 
 Application.LoadLevel(Application.loadedLevel); 
// this line will not execute  so you have to make it true before load level