Search Unity

Do not freeze the screen during the loadlevel frame

Discussion in 'Scripting' started by BooBi, Nov 12, 2010.

  1. BooBi

    BooBi

    Joined:
    Jan 18, 2010
    Posts:
    534
    Hi,

    I modified this script to have multiple splashscreens, and I would like to know if it's possible to do something during the application.loadlevel.

    http://www.unifycommunity.com/wiki/index.php?title=SplashScreen


    The screen freeze, (even when i'm changing between my scenes) I'm doing architectural visualization so quite heavy scenes. Is it possible to animate a gui, or do something on the screen at the moment when it loading the next scene ?

    Right now, My last splash screen (during the loading) shows few lines of text.

    If some one has an idea

    BooBi
     
  2. Ntero

    Ntero

    Joined:
    Apr 29, 2010
    Posts:
    1,436
  3. BooBi

    BooBi

    Joined:
    Jan 18, 2010
    Posts:
    534
    Hi,

    I come back on this problem, and it still doesn't work.

    To work easily, I've built a really simple scene, with a wheel (a simple image) as a GUI which rotate and a button to start the next scene.

    My problem :

    When unity is loading a new scene, it freeze the application. The "frost" duration depends on the computer power. I don't know the configuration of the computers which will open the project.


    My goal:

    My goal is to keep this wheel rotating while my next scene is loaded. (It's a standalone, not a web thing, no streaming). My next scene is quite heavy (80K poly etc).


    I've tried these lines to load my level (one at the time obviously):
    Code (csharp):
    1.  
    2.             if (GUI.Button(new Rect(100, 100, 50, 50), "load"))
    3.             {
    4.                 //Application.LoadLevel(1);
    5.                 //Application.LoadLevelAsync("scene_02");
    6.                 StartCoroutine(load());
    7.             }
    8.             if (wheel == true)
    9.             {
    10.                 gui wheel...
    11.             }
    12.  
    13.     IEnumerator load()
    14.     {
    15.         //AsyncOperation async = Application.LoadLevelAsync("scene_02");
    16.         //AsyncOperation async = Application.LoadLevelAdditiveAsync("scene_02");
    17.        
    18.         yield return async;
    19.         wheel = false;
    20.     }
    21.  
    Unity 3, C# and for windows Standalone.

    Thank's for your help !
     
  4. BooBi

    BooBi

    Joined:
    Jan 18, 2010
    Posts:
    534
    up!!
     
  5. giyomu

    giyomu

    Joined:
    Oct 6, 2008
    Posts:
    1,094
    on the doc page you can see >>
    This function requires Unity Pro.

    so if you don't have pro it is normal it doesnt work . if you have it then it is another story ^^
     
  6. BooBi

    BooBi

    Joined:
    Jan 18, 2010
    Posts:
    534
    yep I've got the pro version :S
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    with pro it should work but there is still a small stutter when the graphic assets are pushed to gpu by my experience but its a << 1s thing at least for me when using AssetBundles and loadasync there (not used the scene async one in a long time as the lack of one hit unload makes it only meaningfull for me to load "gui scenes" on top of an ongoing game scene
     
  8. BooBi

    BooBi

    Joined:
    Jan 18, 2010
    Posts:
    534
    yep but if I'm doing a loading scene(cam with splashscreens, wheel loading) inside my actual scene I'll need to wait in front of a black screen first, and the clients in general don't like that... so i rather prefer a little wait in front of some text or a logo than just waiting in the dark an wondering if it's crashed.

    and yes the time between the two scenes is quite short, so is it possible to trick this frost frame or it isn't and I'll deal with it with some text ?

    (the scene is a part of a town modelised with a part in high details, textured in unity. I optimized the scene a lot but it still a big scene... I don't have this problem with the other scenes because they load a lot faster.

    I didn't try the assetbundles, is it only for streaming ? I'll take a look at that this weekend.
     
    Last edited: Dec 2, 2010