문제

I am building a game in Unity, and I am using Visual Studio 2013 as my default IDE. Whenever I create a file, it asks me if I want to normalize the line endings because the are not consistent (details on that here: What does Visual Studio mean by normalize inconsistent line endings?).

Should I say yes or no?

My best guess would be that if I say "Yes", it will clean up the Mac and Linux stuff that Windows doesn't care about, so it will only run on Windows. My best guess for choosing "No" is that it will keep the code to run on each of all three platforms without affecting the other two. Is this correct?

도움이 되었습니까?

해결책

Is there a chance that you will switch between IDEs and/or operating systems while working on the project or are you working with other people?

If so you need to care about the line endings of your project files and it might be a bad idea to change them because other IDEs may not be able to understand them. However having that message popping up every time you open a file can be a pain in the @ss. You can toggle this behaviour going to:

Tools -> Options -> Documents -> Check for consistent line endings on load

If not you can change them and you will have no problems wherever the platform the game will run. I only use Visual Studio 2013 w/ Windows 8.1 when working with Unity and I normalize line endings every time. I never had a problem with it even when running the game in different platforms. I guess it can only affect the code editors and the compiler tools. After the compilation line endings do not matter anymore.

다른 팁

For most use cases it doesn't really matters. Chances are that you will use either VS or MonoDevelop. Both can handle different line endings. It only matters if you are intending to use some editor which is sensible to line endings style.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top