From ec1f4a9a4ba6884f5ec0a11bdc32fb47af5e7e1e Mon Sep 17 00:00:00 2001 From: Withaust Date: Sun, 30 Aug 2026 10:48:35 +0300 Subject: [PATCH] Fix headless editor & Roslyn analyzer include resolution --- Source/Editor/Windows/GameWindow.cs | 7 ++++--- .../Projects/VisualStudio/CSSDKProjectGenerator.cs | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index d351147cb..4032e0aff 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -672,9 +672,10 @@ namespace FlaxEditor.Windows IsBorderless = false; Cursor = CursorType.Default; Screen.CursorLock = CursorLockMode.None; - if (Screen.MainWindow.IsMouseTracking) - Screen.MainWindow.EndTrackingMouse(); - RootControl.GameRoot.EndMouseCapture(); + var mainWindow = Screen.MainWindow; + if (mainWindow != null && mainWindow.IsMouseTracking) + mainWindow.EndTrackingMouse(); + RootControl.GameRoot?.EndMouseCapture(); } /// diff --git a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs index ffc95e047..e99b5b328 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudio/CSSDKProjectGenerator.cs @@ -330,9 +330,7 @@ namespace Flax.Build.Projects.VisualStudio foreach (var analyzer in configuration.TargetBuildOptions.ScriptingAPI.Analyzers) { csProjectFileContent.AppendLine(string.Format(" ", configuration.Name)); - csProjectFileContent.AppendLine(string.Format(" ", Path.GetFileNameWithoutExtension(analyzer))); - csProjectFileContent.AppendLine(string.Format(" {0}", Utilities.MakePathRelativeTo(analyzer, projectDirectory).Replace('/', '\\'))); - csProjectFileContent.AppendLine(" "); + csProjectFileContent.AppendLine(string.Format(" ", Utilities.MakePathRelativeTo(analyzer, projectDirectory).Replace('/', '\\'))); csProjectFileContent.AppendLine(" "); }