Unity Editor中使用AssetBundle里的shader遇到的问题

Unity版本:5.3.4及以上

现象:在Unity Editor里,将一个prefab打包成Android 平台的assetbundle,再load出来,看到的prefab表现与实际的prefab表现不一致

原因:Android平台的assetbundle里的shader只能在Android手机上正常使用;在Unity Editor中,即使切换到了Android平台,也不能正常使用;

本来应该看到的是表明shader错误的粉红色shader,但是如果shader有fallback,会使用fallback的shader来渲染。

这是因为:打包到AssetBundle里的Shader是Android版本的,但是编辑器需要的是Windows/OSX版本的。

解决:如果非要在Unity Editor中看到正常的shader表现,可以将assetbundle打包成WindowsStandalone平台的,这样就可以在编辑器里使用了

 

或者在打包的时候,PC的projectsettings里,图形api改成opengles

 

补充:跟https://blog.csdn.net/huutu/article/details/50551262 不谋而合

 

http://answers.unity3d.com/questions/238109/problem-with-materials-after-creating-asset-bundle.html
 

你可能感兴趣的:(Unity Editor中使用AssetBundle里的shader遇到的问题)