@@ -17,18 +17,6 @@ internal static class Core
17
17
{
18
18
private static bool IsGlobal { get ; }
19
19
20
- public static void DirtyScriptsIfNeeded ( )
21
- {
22
- var assemblyName = GetAssemblyName ( FindAsmdef ( ) ) ;
23
- if ( ! IsGlobal && string . IsNullOrEmpty ( assemblyName ) ) return ;
24
-
25
- var filepath = "Temp/" + typeof ( Core ) . Assembly . GetName ( ) . Name + ".loaded" ;
26
- if ( File . Exists ( filepath ) ) return ;
27
- File . WriteAllText ( filepath , "" ) ;
28
-
29
- Utils . RequestCompilation ( IsGlobal ? null : assemblyName ) ;
30
- }
31
-
32
20
public static string GetAssemblyName ( string asmdefPath )
33
21
{
34
22
if ( string . IsNullOrEmpty ( asmdefPath ) ) return null ;
@@ -268,6 +256,7 @@ public static void OnAssemblyCompilationStarted(string name)
268
256
269
257
static Core ( )
270
258
{
259
+ // For development assemblies: Do nothing.
271
260
var coreAssemblyName = typeof ( Core ) . Assembly . GetName ( ) . Name ;
272
261
if ( coreAssemblyName == "CSharpCompilerSettings_" ) return ;
273
262
@@ -315,21 +304,15 @@ static Core()
315
304
CompilationPipeline . assemblyCompilationStarted -= OnAssemblyCompilationStarted ;
316
305
CompilationPipeline . assemblyCompilationStarted += OnAssemblyCompilationStarted ;
317
306
318
- // Install custom csc before compilation.
307
+ // Install custom compiler package before compilation.
319
308
var settings = GetSettings ( ) ;
320
309
if ( ! settings . UseDefaultCompiler )
321
310
CompilerInfo . GetInstalledInfo ( settings . CompilerPackage . PackageId ) ;
322
311
312
+ // Install analyzer packages before compilation.
323
313
if ( IsGlobal )
324
314
foreach ( var package in settings . AnalyzerPackages . Where ( x => x . IsValid ) )
325
315
AnalyzerInfo . GetInstalledInfo ( package . PackageId ) ;
326
-
327
- // If Unity 2020.2 or newer, request re-compilation.
328
- var version = Application . unityVersion . Split ( '.' ) ;
329
- var major = int . Parse ( version [ 0 ] ) ;
330
- var minor = int . Parse ( version [ 1 ] ) ;
331
- if ( 2021 <= major || ( major == 2020 && 2 <= minor ) )
332
- DirtyScriptsIfNeeded ( ) ;
333
316
}
334
317
}
335
318
}
0 commit comments