【U3D】AssetBundle.CreateFromFile()加载资源失败

使用AssetBundle.CreateFromFile()创建assetBundle失败:

1、确保打包assetBundle时使用的option包括BuildOptions.UncompressedAssetBundle,因为只能加载非压缩资源

2、AssetBundle.CreateFromFile()的加载路径不同于 WWW.assetBundleWWW.LoadFromCacheOrDownload,

如:WWW download = WWW.LoadFromCacheOrDownload ("file://"+Application.dataPath+"/StreamingAssets" + "/MyScene.unity3d", 1);

AssetBundle bundle = AssetBundle.CreateFromFile (Application.dataPath + "/StreamingAssets" + "/MyScene.unity3d");

差别在于"file://"

你可能感兴趣的:(option,资源,download)