question about load level

I have three scenes( levels) , and I want to show them one by one, then they can be shown in the last view.
For example,
I want to load level per level with DontDestroyOnLoad too keep some elements :
level 1 : GUI camera (to keep) and some object elements (to keep)
level 2 : other object elements (to keep)
level 3 : remain object elements (to keep)

I use Application.LoadLevel at each Level to load the new one : when the Level X is loading, then load the level X+1 .
The result is that I have all elements in the first and third level shown at last, but I lost all elements in the second level. I don’t known why? Can anybody help me?

The following is my code:
Code:

var levelToLoad : int = 0; 
function Awake() 
{ 
   while (levelToLoad<=2) 
    { 
          if (Application.CanStreamedLevelBeLoaded (levelToLoad)) 
           { 
                 if(Application.GetStreamProgressForLevel (levelToLoad)==1.0) 
              { 
                 Debug.Log("begin:" + levelToLoad); 
                 Application.LoadLevel (levelToLoad); 
               Debug.Log("End:" + levelToLoad); 
                 levelToLoad++; 
              }          
      }       
   }    
}

here is the log file:
begin:0
UnityEngine.Debug:Log(Object)
End:0
UnityEngine.Debug:Log(Object)
begin:1
UnityEngine.Debug:Log(Object)
End:1
UnityEngine.Debug:Log(Object)
begin:2
UnityEngine.Debug:Log(Object)
End:2
UnityEngine.Debug:Log(Object)

By the way is that the level means a scene?

Am i wrong somewhere in the code? Plz help, if anyone knows what’s wrong with my topic, plz figure out.

I am not completely clear on what is happening as a result of your code, but I notice that no one else has offered any suggestions, so here goes…

First, the easy one: it seems that “Level” and “Scene” refer to the same thing. (This was the same in Virtools)

Second, the hard part: You are attempting to load these levels in the Awake function, which is called when the object is loaded (the precise definition is in the docs). Would Start() be a better place to do this?

Can you provide some more context? What object is this script attached to?

(I a probably not helping at all.)

the script looks like it’s doing what it’s supposed to. did you double check that the objects you’re losing really have dontdestroyonload applied? that would be my first guess without seeing more of the project.