应该有不少人在用VS编写脚本时遇到过如下的警告信息
There are inconsistent line endings in the 'XXX' script. Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
虽然并无什么大碍,但是影响心情啊,其实想要解决也很简单,进入你安装unity的文件夹“\Unity\Editor\Data\Resources\ScriptTemplates”,将里面所有的文件用VS打开,在主菜单中选择“File-Advanced Save Options”将Line endings改成“Windows(CR LF)”,这样再创建的脚本就不会存在这样的问题了。
本文介绍如何解决使用VS编写脚本时出现的不一致换行符问题,通过修改Unity安装目录下ScriptTemplates文件夹内的文件换行符设置为Windows格式(CRLF),避免在后续开发过程中出现错误提示。
6615

被折叠的 条评论
为什么被折叠?



