Search Unity

[Unity5.5.4.p1&p5] Resource.LoadAsync seems blocking the main thread in Android(In editor is fine)

Discussion in 'Editor & General Support' started by kiffa, Sep 20, 2017.

  1. kiffa

    kiffa

    Joined:
    Jun 5, 2017
    Posts:
    2
    var st = new Stopwatch();
    st.Start();
    Resources.LoadAsync("large_prefab");
    Debug.log("Time: " + st.ElapsedMilliseconds);


    In Editor(Win7): the "Time" is 0.
    On Android devices, the "Time" is 5000+.
    I think this is a bug. Even after loading sync, the time is still 5000+.

    var st = new Stopwatch();
    Resources.Load("large_prefab");
    st.Start();
    Resources.LoadAsync("large_prefab");
    Debug.log("Time: " + st.ElapsedMilliseconds); // 5000+ms on android devices
     
  2. kiffa

    kiffa

    Joined:
    Jun 5, 2017
    Posts:
    2
    I want to make a background-preloading system which will preload assets with Resources.LoadAsync when cpu idle, but the Resources.LoadAsync will cause lag on Android devices.
    Any suggestion?