@@ -260,8 +260,8 @@ static EditorStateCache()
260260 EditorApplication . playModeStateChanged += _ => ForceUpdate ( "playmode" ) ;
261261
262262 // Tracks whether an assembly compilation is actually running, for
263- // GetActualIsCompiling's Play-mode check . Statics reset on domain reload
264- // and this [InitializeOnLoad] ctor re-subscribes, so the flag is per-domain.
263+ // GetActualIsCompiling. Statics reset on domain reload and this
264+ // [InitializeOnLoad] ctor re-subscribes, so the flag is per-domain.
265265 UnityEditor . Compilation . CompilationPipeline . compilationStarted += _ => _pipelineCompilationRunning = true ;
266266 UnityEditor . Compilation . CompilationPipeline . compilationFinished += _ => _pipelineCompilationRunning = false ;
267267
@@ -288,7 +288,7 @@ private static void OnUpdate()
288288 {
289289 // Throttle to reduce overhead while keeping the snapshot fresh enough for polling clients.
290290 double now = EditorApplication . timeSinceStartup ;
291- // Use GetActualIsCompiling() to avoid Play mode false positives (issue #582 )
291+ // Use GetActualIsCompiling() to avoid isCompiling false positives (issues #549, #1276 )
292292 bool isCompiling = GetActualIsCompiling ( ) ;
293293
294294 // Check for compilation edge transitions (always update on these)
@@ -543,10 +543,12 @@ public static JObject GetSnapshot()
543543 private static bool _pipelineCompilationRunning ;
544544
545545 /// <summary>
546- /// Returns the actual compilation state, working around a known Unity quirk where
547- /// EditorApplication.isCompiling can return false positives in Play mode (e.g. a
548- /// recompile deferred by Recompile-After-Finished-Playing keeps it true for the
549- /// whole play session). See: https://github.com/CoplayDev/unity-mcp/issues/549
546+ /// Returns the actual compilation state, working around known Unity quirks where
547+ /// EditorApplication.isCompiling reports false positives while no compilation is
548+ /// running: a recompile deferred by Recompile-After-Finished-Playing keeps it true
549+ /// for the whole play session (issue #549), and a project holding
550+ /// EditorApplication.LockReloadAssemblies keeps it true until the lock is released
551+ /// (issue #1276). In both cases the event-tracked pipeline flag is authoritative.
550552 /// </summary>
551553 internal static bool GetActualIsCompiling ( )
552554 {
@@ -556,16 +558,9 @@ internal static bool GetActualIsCompiling()
556558 return false ;
557559 }
558560
559- // In Play mode, trust the event-tracked pipeline state instead: a deferred
560- // recompile keeps EditorApplication.isCompiling true without any compilation
561- // actually running.
562- if ( EditorApplication . isPlaying )
563- {
564- return _pipelineCompilationRunning ;
565- }
566-
567- // Outside Play mode the raw signal is reliable.
568- return true ;
561+ // Otherwise trust the event-tracked pipeline state: isCompiling stays true for as
562+ // long as an assembly reload is deferred, with no compilation actually running.
563+ return _pipelineCompilationRunning ;
569564 }
570565 }
571566}
0 commit comments