[Unity]记坑:MaterialPropertyBlocks.SetTexture与Resources.UnloadUnusedAssets
2020/12
10
22:12
如果使用了MaterialPropertyBlocks的SetTexture
但是Texture对象没有被脚本其它对象引用,那么此Texture对象是非持久的,会被Resources.UnloadUnusedAssets回收
下场就是纹理丢失
解决方案是在脚本中,添加对Texture对象的显示引用(坑)
CopyRights: The Post by BY-NC-SA For Authorization,Original If Not Noted,Reprint Please Indicate From 老刘@开发笔记
Post Link: [Unity]记坑:MaterialPropertyBlocks.SetTexture与Resources.UnloadUnusedAssets
Post Link: [Unity]记坑:MaterialPropertyBlocks.SetTexture与Resources.UnloadUnusedAssets