在Window上使用Visual Studio编辑Unity3D脚本时常会出现类似如下警告:

警告 1 There are inconsistent line endings in the 'Assets/DubugTest.cs' 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. 0 0 解决方案“UnityVS.TestUnityVS”?(1 个项目)

虽然不影响使用,但一堆警告信息着实让人不爽,继续往下看。

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

解决办法

将脚本文件换行编码统一改为“CR LF”就可以了。

用Visual Studio打开需要修改的文件,然后“文件->高级保存选项” 行尾选择“Windows (CR LF)”保存

Unity安装目录\Editor\Data\Resources\ScriptTemplates\目录下的所有文件用上面的方式修改换行编码,以后通过Unity3D编辑器创建的文件将默认以“CR LF”换行,一劳永逸。

参考资料:
http://www.cnblogs.com/sevenyuan/archive/2012/12/06/2805114.html

There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows.问题解决的更多相关文章

  1. inconsistent line endings 解决方法

     I'm using Unity 3D in combination with Visual Studio 2008 on a Windows 7 64 bit system. When savi ...

  2. Unity3D脚本行尾(Line Endings)

    行尾不一致(inconsistent line endings ) 开发环境 有时候编辑Unity的脚本文件,代码diff之后,或者从svn更新文件之后,Unity中会出现行尾不一致的信息. 我的开发 ...

  3. inconsistent line count calculation in projection snapshot

    1.现象 在vs2013中,按Ctrl + E + D格式化.cshtml代码,vs2013系统崩溃.报:inconsistent line count calculation in projecti ...

  4. git 提交报错 : The file will have its original line endings in your working directory.

    报错现象 git  add . 的时候发现此报错 报错分析 看情况应该是不同系统对换行的识别不到位导致的 就常识来说文件是在windows下生成的所以换行和 linux 确实不同可能是因为这个导致的 ...

  5. The file will have its original line endings in your working directory.

    在空仓库的情况下,add,出现一下问题 The file will have its original line endings in your working directory. 当报这个警告时是 ...

  6. [Git add . ] 遇到The file will have its original line endings in your working directory 解决办法

    1.在新项目中使用[ git add . ]时出现: warning: LF will be replaced by CRLF in ...... The file will have its ori ...

  7. Git提交时提示‘The file will have its original line endings in your working directory’

    Git提交时提示'The file will have its original line endings in your working directory' Git出现错误 git add -A ...

  8. windows10下git报错warning: LF will be replaced by CRLF in readme.txt. The file will have its original line endings in your working directory.

    window10下使用git时 报错如下: $ git add readme.txtwarning: LF will be replaced by CRLF in readme.txt.The fil ...

  9. 解决git报错“The file will have its original line endings in your working directory”的方法

    在执行命令 git commit --all -m  '说明' 时报错“The file will have its original line endings in your working dir ...

随机推荐

  1. [na]mail收发过程

    以前老记不住这smtp和pop3谁收谁发. 简单邮件传输协议(SMTP),用来发送或中转发出的电子邮件,       占用tcp 25端口. 第三版邮局协议(POP3),用于将服务器上把邮件存储到本地 ...

  2. PHP 对 memcache操作类

    <span style="font-size:18px;">class myMemcache { private $memcache; /** * 一般建议这2个值做成 ...

  3. TensorFlow人脸识别

    TensorFlow框架做实时人脸识别小项目(一)https://blog.csdn.net/Goerge_L/article/details/80208297 TensorFlow框架做实时人脸识别 ...

  4. error C1083: 无法打开包括文件:“pthread.h”

    在AssetsManager项目上右键属性->配置->配置属性->C/C++->常规->附加包含目录->点中,倒三角,编辑,在最后引导路径到pthread.h文件夹 ...

  5. electron 的中文文档的地址 以及 窗口改变的步骤

    electron的中文文档的地址: http://www.kancloud.cn/wizardforcel/electron-doc/137791 1.如何创建窗口和改变窗口: import { Br ...

  6. 【转】10张图带你深入理解Docker容器和镜像

    [转自]:http://dockone.io/article/783 待续

  7. c++之—— lambda表达式(有个未能解决的问题等待大佬解答)——(在stack overflow找到了答案)

    谓词: 谓词是一个可调用的表达式,其返回结果是一个能用作条件的值.标准库算法所使用的谓词分为两类:一元谓词,意味着它只接受单一参数:二元谓词,意味着它有两个参数.接受谓词参数的算法对输入序列中的元素调 ...

  8. maven项目install时候一直报错,检查Maven-javadoc-plugin声明错误(Java 8 配置Maven-javadoc-plugin)或者是:警告: @throws 没有说明

    在升级JDK至1.8之后,使用Maven-javadoc-plugin插件打包报错,[ERROR] Failed to execute goal org.apache.maven.plugins:ma ...

  9. dubbox-admin-2.8.4和dubbox-monitor安装

    一.安装zookeeper 安装过程参照以前写的一篇博客http://www.cnblogs.com/520playboy/p/6235415.html 二.dubbox 1.准备工作下载dubbox ...

  10. 【Unity笔记】关于UGUI的根节点Canvas

    创建UGUI物体时,会自动创建Canvas物体作为所有UGUI的根节点.该物体身上有个Canvas脚本,Render Mode渲染模式选项: Screen Space - Overlay:即使场景中没 ...