Skip to content

Commit 6d503d4

Browse files
committed
Allowed EOLConversion to change Editor Settings.
The editor setting isn't documented, but it is available and editable. Wasnt able to determine when it was added but it does work for Unity 2018.1
1 parent 9eae079 commit 6d503d4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Editor/Tools/EOLConversion.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public class EOLConversion : UnityEditor.AssetModificationProcessor
1717
private static void ConvertToWindows()
1818
{
1919
EditorPrefs.SetString(PREFS_PREFERED, "\r\n");
20+
#if UNITY_2018_1_OR_NEWER
21+
EditorSettings.lineEndingsForNewScripts = LineEndingsMode.Windows;
22+
#endif
2023
Convert("\r\n");
2124
}
2225

@@ -25,6 +28,9 @@ private static void ConvertToWindows()
2528
private static void ConvertToUnix()
2629
{
2730
EditorPrefs.SetString(PREFS_PREFERED, "\n");
31+
#if UNITY_2018_1_OR_NEWER
32+
EditorSettings.lineEndingsForNewScripts = LineEndingsMode.Unix;
33+
#endif
2834
Convert("\n");
2935
}
3036

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.lachee.utilities",
3-
"version": "1.4.6",
3+
"version": "1.4.7",
44
"displayName": "Lachee's Utilities",
55
"description": "Bunch of utility functionality",
66
"unity": "2019.1",

0 commit comments

Comments
 (0)