unity 打包 windows 运行 紫色 粉红色

unity下建立了个小demo,在editer里面运行正常。如下

 

但是一旦打包发布到android或者windows下就出现了类似这种情况

这种一般是由于材质贴图的缺失,一般来说选定的默认贴图的话会打包到文件中的。如果出现这种情况,可以尝试代码动态加载一个材质球。如下

Material materialWall = Resources.Load("Materials\\materialWall") as Material;
wallTemp.GetComponent<Renderer>().material = materialWall;

  

这样可以暂时解决问题,不过后面又发现他自己又好了。真是不可理喻。以后再研究吧

posted on 2016-11-09 23:03  李文乔  阅读(1109)  评论(0编辑  收藏  举报

导航