sceneManager.loadscene加载场景时不会主动去加载场景的依赖包,要手动加载或添加场景到build setting列表中...

sceneManager.loadscene加载场景时不会主动去加载场景的依赖包,要手动加载或添加场景到build setting列表中

假设有一场景1001.unity,,manifest文件如下:

ManifestFileVersion: 0
CRC: 425184873
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: cd79999108bfb0a6a2695b1a33471bb4
TypeTreeHash:
serializedVersion: 2
Hash: 31d6cfe0d16ae931b73c59d7e0c089c0
HashAppended: 0
ClassTypes: []
Assets:
- Assets/res/Scenes/1001/1001.unity
Dependencies:
- F:/ProjectMobile/project/Assets/../debug/android/resource/assets/res/prefabs/effects/e_char/fazhen.assetbundle
- F:/ProjectMobile/project/Assets/../debug/android/resource/assets/res/prefabs/effects/e_scene/e_m001_shuizhengqi1.assetbundle
- F:/ProjectMobile/project/Assets/../debug/android/resource/assets/res/prefabs/effects/e_scene/e_m001_guangshu01/e_m001_guangshu01.assetbundle
- F:/ProjectMobile/project/Assets/../debug/android/resource/assets/res/prefabs/effects/e_scene/e_m001_taohuaban01/e_m001_taohuaban01.assetbundle
- F:/ProjectMobile/project/Assets/../debug/android/resource/assets/res/map/jiangnan.assetbundle

 

打包时,1001.unity打成了 1001.ab, 上面的依赖资源打成了 1001res.ab。

则直接scenemanager.loadscene(1001)会提示出错:

scene '1001' couldn't be loaded because it has not been added to the build settings or the assetbundle has not been loaded.

posted on 2017-07-06 15:13 时空观察者9号 阅读(...) 评论(...) 编辑 收藏

你可能感兴趣的:(sceneManager.loadscene加载场景时不会主动去加载场景的依赖包,要手动加载或添加场景到build setting列表中...)