I don’t know if anyone have this error, but currently i am having some sort of weird problem in that, sometimes when i am editing scripts in Visual studio 2010, and i switch back to my Unity, it will say something about
There are inconsistent line endings in the 'Assets/Testing/Buttons.cs' 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.
And this happens sometimes when i create a new script, open with VS2010 and then close it. I know this isn’t anything as serious as crashing problem in 3.4 but it is kinda annoying for me.
It looks that when Unity creates scripts it uses Unix line endings while VS uses windows endings. Unix ones probably use only ‘\n’ character while windows use both ‘\r’ and ‘\n’. So whenever you write new line in your file VS will add “\r\n” in that place. But if you save that file and then try to open it again VS will ask you if you want to standardize line endings. You don’t need to reopen VS. I’m looking for an option in unity to write line endings in Windows format.
Edit: I know it’s old post but still somebody may find it useful.
Visual Studio has an option to set the line endings to Windows or Unix style under File → Advanced Save Options → Line endings, so you can use that and then save the file. Alternatively you could edit the script templates from which the new scripts are created and change the line endings there to Windows style. These are located in \Editor\Data\Resources\ScriptTemplates… But then if you edit those scripts with MonoDevelop it will give you a warning there… I found that annoying so I made Script Inspector always check the line ending style of the first line and unify the rest automatically
Note that shaders used to not compile with Windows style line endings (not sure is that still the case with the latest Unity), so don’t change that template or the line endings in the shader files! Si2 is smart enough and takes care about that too, silently