Hello
some time I get the error “You are trying to load data from a www stream which has not completed the download yet. You need to yield the download or wait until isDone returns true.” as if I wouldn’t yield it.
At the moment I just try to avoid this problem by waiting a little longer until the asset bundle is loaded.
Reproducable on Unity 5.4.2f2 and 5.4.4f1 (5.5.1f1 there are other problems)
using (WWW www = new WWW(path)) {
#if UNITY_UWP
Debug.Log("try to load www path " + path);
#endif
yield return www;
#if UNITY_UWP
Debug.Log("after yield www.isDone " + www.isDone + ", www.progress " + www.progress+ ", www.error '" + www.error + "' , assetBundle =" +
(www.assetBundle == null ? "null" : www.assetBundle.ToString()));
// Strange error on Windows Store App:
// You are trying to load data from a www stream which has not completed the download yet.
// You need to yield the download or wait until isDone returns true.
float waitTime = 0f;
while (!www.isDone || www.progress < 1f || www.assetBundle == null)
{
yield return new WaitForSeconds(0.1f);
waitTime += 0.1f;
Debug.Log("www.isDone " + www.isDone + ", www.progress " + www.progress + ", assetBundle =" + (www.assetBundle == null ? "null" : www.assetBundle.ToString()));
if(waitTime > 5f)
{
Debug.Log("ERROR AssetBundle couldn't be loaded!");
yield break;
}
}
#endif
if (!string.IsNullOrEmpty(www.error)) {
Debug.LogWarning(www.error);
yield break;
}
...
}