`
yanfaguanli
  • 浏览: 658609 次
文章分类
社区版块
存档分类
最新评论

unity发布失败,文件读取出错的解决方法(The file 'resources.assets' is corrupted)

 
阅读更多

The file 'xxxx/resources.assets' is corrupted! Remove it and launch unity again! [Position out of bounds! 11854196 > 11854192]

unity在editor中运行时正常,但是发布后出现上述错误(windows平台,其他平台理论上也会出错)。

脚本执行不正常。功能出错。

原因是脚本中存在同名文件(比如Damage.js和Damage.cs),出现同名文件后,unity读取就有问题了。

猜想unity中文件是通过文件名哈希存储的,比如Resources.Load读取文件时,不需要扩展名,并且可以不需要路径名。

所以在unity中维护资源的时候,保证文件名唯一性,别给自己出bug的机会。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics