11using System . IO ;
2+ using System . Linq ;
3+ using System . Text . RegularExpressions ;
24using UnityEditor ;
35using UnityEditorInternal ;
46using UnityEngine ;
@@ -13,6 +15,11 @@ internal class CscSettingsProvider
1315 private static SerializedProperty s_AnalyzerFilter ;
1416 private static ReorderableList s_RoAnalyzerPackages ;
1517
18+ private static GUIContent s_HeaderCompiler = new GUIContent ( "Compiler" ) ;
19+ private static GUIContent s_HeaderAnalyzer = new GUIContent ( "Analyzer" ) ;
20+ private static GUIContent s_HeaderDebug = new GUIContent ( "Debug" ) ;
21+
22+
1623 [ SettingsProvider ]
1724 private static SettingsProvider CreateSettingsProvider ( )
1825 {
@@ -50,7 +57,7 @@ private static SettingsProvider CreateSettingsProvider()
5057
5158 private static void OnGUI ( string searchContext )
5259 {
53- EditorGUILayout . LabelField ( "Compiler" , EditorStyles . boldLabel ) ;
60+ EditorGUILayout . LabelField ( s_HeaderCompiler , EditorStyles . boldLabel ) ;
5461 if ( InspectorGUI . DrawCompilerPackage ( serializedObject ) )
5562 {
5663 using ( new GUILayout . HorizontalScope ( ) )
@@ -66,7 +73,7 @@ private static void OnGUI(string searchContext)
6673
6774 EditorGUILayout . Space ( ) ;
6875
69- EditorGUILayout . LabelField ( "Analyzer" , EditorStyles . boldLabel ) ;
76+ EditorGUILayout . LabelField ( s_HeaderAnalyzer , EditorStyles . boldLabel ) ;
7077 using ( new GUILayout . HorizontalScope ( ) )
7178 {
7279 GUILayout . Space ( 4 ) ;
@@ -80,7 +87,7 @@ private static void OnGUI(string searchContext)
8087
8188 EditorGUILayout . Space ( ) ;
8289
83- EditorGUILayout . LabelField ( "Debug" , EditorStyles . boldLabel ) ;
90+ EditorGUILayout . LabelField ( s_HeaderDebug , EditorStyles . boldLabel ) ;
8491 EditorGUILayout . PropertyField ( s_EnableLogging ) ;
8592
8693 // Controls
@@ -91,6 +98,16 @@ private static void OnGUI(string searchContext)
9198 serializedObject . ApplyModifiedProperties ( ) ;
9299 File . WriteAllText ( CscSettingsAsset . k_SettingsPath , JsonUtility . ToJson ( serializedObject . targetObject , true ) ) ;
93100 Utils . RequestCompilation ( ) ;
101+ } ,
102+ onReload : ( ) =>
103+ {
104+ if ( ! EditorUtility . DisplayDialog ( "Reload all portable CSharpCompilerSettings assemblies" , "Reload all CSharpCompilerSettings_***.dll for asmdef files." , "OK" , "Cancel" ) ) return ;
105+
106+ AssetDatabase . FindAssets ( "t:DefaultAsset CSharpCompilerSettings_" )
107+ . Select ( AssetDatabase . GUIDToAssetPath )
108+ . Where ( x => Regex . IsMatch ( Path . GetFileName ( x ) , "CSharpCompilerSettings_([0-9a-zA-Z]{32}).dll" ) )
109+ . ToList ( )
110+ . ForEach ( x => InspectorGUI . EnablePortableDll ( x , true ) ) ;
94111 }
95112 ) ;
96113 }
0 commit comments