Unity3D学习笔记(1)
Unity编辑器Console窗口报错信息:
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. Unitron and other text editors can fix this using Convert Line Endings menu commands.
问题原因:
通过Unity3D编辑器创建的脚本文件是以”LF”结尾(Unix平台),MonoDevelop IDE创建的也是以“LF”结尾(Unix平台),而直接用Visual Studio创建的文件是以“CR LF”结尾(Windows平台)。由于换行编码不一致导致报以上警告。
解决方法:
临时解决方法:将报错文件的换行编码修改下
visual studio打开对应cs文件,File->Advanced save options->Line ending改为Windows (CR LF),即如下图所示