I have a scene "Level2" which is packed in assetbundle and is downloaded online. When I called:
private IEnumerator LoadScene (string path)
{
Debug.Log ("LoadSceneFrom:" + path);
WWW sceneDownloader = WWW.LoadFromCacheOrDownload (path, 1);
yield return sceneDownloader;
AssetBundle bundle = sceneDownloader.assetBundle;
Application.LoadLevel ("Level2");
}
It loaded the Level2. But when I stopped the game in Editor, Unity log the error "Resource file has already been unloaded." in the first time. Then if I stop the game in another run, it just crashed.
The Level2 is OK when I run it alone.
Should I call sceneDownloader.Unload(false) sometime after the Level2 is loaded?
BTW, when I change "WWW.LoadFromCacheOrDownload (path, 1)" to "new WWW (path)", everything OK. Why??
↧