Search Unity

Loading scene best practive

Discussion in 'Daydream' started by TimurB, Mar 3, 2017.

  1. TimurB

    TimurB

    Joined:
    Oct 12, 2016
    Posts:
    21
    I apologize for the newbie question, but there is a little information available.
    My app has one main scene. Originally I thought that Unity asynchronously loads the first scene in build during splash screen. Apparently it is not the case, because I can see black edges when I moving head on startup.

    I think the solution would be to have another very simple scene with some loading animation and code like below:
    Code (CSharp):
    1. AsyncOperation async = SceneManager.LoadSceneAsync(1);
    2. Application.backgroundLoadingPriority = ThreadPriority.BelowNormal;
    3. while (!async.isDone)
    4. {
    5.   yield return null;
    6. }
    But that doesn't help much. I still can see edges.
    How smart developers approach this problem?
     
    Last edited: Mar 3, 2017
  2. TimurB

    TimurB

    Joined:
    Oct 12, 2016
    Posts:
    21
    Maybe I made a wrong word choice in the title. It actually should be:
    "Game freeze when loading" or "Head tracking stops on startup"
    It even present with demo scene from SDK
     
    Last edited: Mar 5, 2017