Quantcast
Channel: Questions in topic: "assetbundle"
Viewing all articles
Browse latest Browse all 1593

how to unload asset when load new scene?

$
0
0
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??

Viewing all articles
Browse latest Browse all 1593

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>