Unity类似于“There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows”一类的警告提示

学习Unity的时候经常会看到如下的类似警告:

There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows.

不会影响正常的使用,但是强迫症表示看着警告不舒服斯基。。。
网上查了查找到了解决原因:

通过Unity3D编辑器创建的脚本文件是以"LF"结尾(Unix平台),MonoDevelop IDE创建的也是以“LF”结尾(Unix平台),而直接用Visual Studio创建的文件是以“CR LF”结尾(Windows平台)。由于换行编码不一致导致报以上警告。

如何解决:

将脚本文件换行编码统一改为“CR LF”。
将*Unity安装目录\Editor\Data\Resources\ScriptTemplates*目录下的所有文件用VS打开,然后“文件->高级保存选项” 行尾选择“Windows (CR LF)”保存,以后通过Unity3D编辑器创建的文件将默认以“CR LF”换行。

Unity类似于“There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows”一类的警告提示_第1张图片
文件->高级保存选项

Ps:参考资料:

http://www.cnblogs.com/sevenyuan/archive/2012/12/06/2805114.html

你可能感兴趣的:(Unity类似于“There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows”一类的警告提示)