在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. ssh 远程执行命令 -t

    # ssh -p22022 -t 122.16.67.116 ls -l /root/.ssh total -rw-r--r-- root root Jan : authorized_keys -rw ...

  2. angular学习笔记(五)-阶乘计算实例(1)

    <!DOCTYPE html> <html ng-app> <head> <title>2.3.2计算阶乘实例1</title> <m ...

  3. PHP5.4新特性之上传进度支持Upload progress

    在PHP5.4版本当中给我们提供了好用的特性,上传进度的支持,我们可以配合Ajax动态获取SESSION当中的上传进度: 在使用这一特性之前,需要现在php.ini文件当中进行相应的设置:   1 2 ...

  4. Spring Boot干货系列:(四)Thymeleaf篇

    Spring Boot干货系列:(四)Thymeleaf篇 原创 2017-04-05 嘟嘟MD 嘟爷java超神学堂 前言 Web开发是我们平时开发中至关重要的,这里就来介绍一下Spring Boo ...

  5. LeetCode: Binary Tree Preorder Traversal 解题报告

    Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' valu ...

  6. python 集合比较(交集、并集,差集)集合方法大全

    python的set和其他语言类似, 是一个无序不重复元素集, 基本功能包括关系测试和消除重复元素. 集合对象还支持union(联合), intersection(交), difference(差)和 ...

  7. eclipse workspace 优化

    换了新的工作空间,当然在开发之前先优化该工作空间啦! 1.换编码 2.优化加载项 去除不用的 3.优化代码检查   不用的去掉 4.禁止更新功能 5.更换字体其他个人偏好设置   微软雅黑 字体5号 ...

  8. Lo4j(二)级别和优化

    在log里面有日志级别: DEBUG Level: 指出细粒度信息事件对调试应用程序是非常有帮助的,就是输出debug的信息.INFO level: 表明消息在粗粒度级别上突出强调应用程序的运行过程, ...

  9. [转]ListView学习笔记(一)——缓存机制

    要想优化ListView首先要了解它的工作原理,列表的显示需要三个元素:ListView.Adapter.显示的数据: 这里的Adapter就是用到了适配器模式,不管传入的是什么View在ListVi ...

  10. SGU 120 Archipelago (简单几何)

    120. Archipelago time limit per test: 0.25 sec.  memory limit per test: 4096 KB Archipelago Ber-Isla ...