About"Application.LoadLevel()"

Hi,All.

My game is made of all use GUI.
However, I encountered a problem.
Memory footprint is very large!

Especially from one scene to another scene when the load.

I would like to ask
Application.Loadlevle ()
In the “A” in the scene using the “Loadlevel (b)”

When the “B” scenario, after loading, A scene automatically destroyed do? “A” scene was also occupy memory? How can I optimize this part?

When a new scene when loaded, the game will crash. Why? :stuck_out_tongue: Thanks.

Do you have some numbers for these scenarios? For example, actual memory usage levels? Also, try loading each level individually, to find what the memory footprint is when you only load Level A, then again for Level B, then for the transition.

When you are in scene b, scene a is unloaded.
The crash happens because during the transition from a to b, there is a timeframe where both scenes are present (at least thats my interpretation of what happens and on the consequence of the solution I and many others long before me use)

I’ve created myself a nice little scene manager class with loading screen managing etc, that goes from scene a to scene 0 to scene b
scene 0 is my loader scene, it contains nothing else than the scene manager singleton instance that redirects by default to the menu screen.

that gives a nice startup time and as far as I see faster scene transition and less memory border hittings

thanks for the tip dreamora!

Thank fot dreamora.

I try it. Good luck… :lol:

Very nice. Thanks for that.

Nothing to thank me for.
I’m just the one repeating this old trick from the 1.0.x days

0 scene:

function Start () {
	Application.LoadLevel(PlayerPrefs.GetInt("NeedLoadNum"));
}

a scene:

	PlayerPrefs.SetInt("NeedLoadNum",2);
	Application.LoadLevel(6); //6="0 scene"

2=“b scene”


Right?Other good way? :idea: