Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

make the loading screen untill assets buffer from server to scene

Discussion in 'Scripting' started by JackiM, Apr 14, 2014.

  1. JackiM

    JackiM

    Joined:
    Aug 21, 2012
    Posts:
    20
    Hi,

    I put my asset in my server at the runtime i am calling the asset. When i starting the scene in webplayer it is open but assets taking some seconds to load the scene from server. I have to make one loading image in this mean time(until my asset present in the scene).

    I have used www.isDone but its not giving the solution. i need a professional way to do this.

    Please help me to get me out of this.

    Thanks.
     
  2. Patico

    Patico

    Joined:
    May 21, 2013
    Posts:
    886
    I hope you have used it with coroutine? Anyway it's hard to give any advise without of piece of your code.
     
  3. JackiM

    JackiM

    Joined:
    Aug 21, 2012
    Posts:
    20
    this is my code

    Code (csharp):
    1.  
    2. var url3 = "file:///D:/Unity3d/Projects/file.unity3d";
    3. private var dld: boolean = false;
    4. function Start () {
    5.      // Start a download of the given URL
    6.     var www3 : WWW = new WWW(url3);
    7.    
    8.     if(www3.isDone)
    9.     {
    10.         dld = true;
    11.     }
    12.     else
    13.     {
    14.         dld = false;
    15.     }
    16.    
    17.     // Wait for download to complete   
    18.     yield www3;
    19.  
    20.     // assign texture
    21.     Instantiate(www3.assetBundle.mainAsset, Vector3(0,2, 0), Quaternion.identity);
    22. }
    23.