Search Unity

¿Best approach to Load many many Levels?

Discussion in 'Scripting' started by jorgeburnes, Sep 29, 2010.

  1. jorgeburnes

    jorgeburnes

    Joined:
    Jun 18, 2008
    Posts:
    37
    What would be the best way I could use. If you have to load multiple levels and requires the unityplayer is very small.

    1. Create Assets Bundles of each level of a prefab by level?:confused:
    2. Creating Scenes for each level and create a prefab for each scene?:confused:
    3. Create multiple players and load the player into the main player?:confused:
    4. Create multiple Scenes at each level and load asynchronously in the primary?:confused:

    Any other possible option?:confused:

    Thanks for your answers :)
     
  2. Nico30

    Nico30

    Joined:
    Nov 9, 2009
    Posts:
    39
    Well, I could think about 2 approaches:

    1.) Every Level 1 Scene
    Just make an empty GameObject and assign it a script with this content:
    Code (csharp):
    1.  
    2. Application.LoadLevelAsync("Level2");
    3. Application.LoadLevelAsync("Level3");
    4. Application.LoadLevelAsync("Level4");
    5.  
    This way you can preload them. Best would be to leave the camera black and fade it in once this code has finished.

    2.) 1 Scene, multiple levels.

    Build multiple levels in 1 Scene and just teleport your player-object to the new area once he is done in the prev. level. Would not work very good with Outdoor Stuff I guess. But if you got for example interiors which are seperated you could have them under the terrain and port your player there.
     
    Last edited: Sep 29, 2010
  3. jorgeburnes

    jorgeburnes

    Joined:
    Jun 18, 2008
    Posts:
    37

    I thought of another option for making the first main scene light level would have an empty, With a GameObject to load the first level of unity to the load would be too fast and could fade with screen loading screen, the main scene, this is feasible?