diff --git a/.github/workflows/dead-code.yml b/.github/workflows/dead-code.yml index c25e83ad49..2595aea67f 100644 --- a/.github/workflows/dead-code.yml +++ b/.github/workflows/dead-code.yml @@ -45,3 +45,4 @@ jobs: --include-kept false --format table --fail-on high-confidence + --max-public-candidates 22 diff --git a/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutionFacadeTests.cs b/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutionFacadeTests.cs index dfe42b9d06..e7b0477381 100644 --- a/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutionFacadeTests.cs +++ b/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutionFacadeTests.cs @@ -183,11 +183,6 @@ public async Task ExecuteCodeAsync( }; } - public ExecutionStatistics GetStatistics() - { - return new ExecutionStatistics(); - } - public void Dispose() { DisposeCallCount++; diff --git a/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutorPoolTests.cs b/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutorPoolTests.cs index 2fb5107e64..363da6d3a4 100644 --- a/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutorPoolTests.cs +++ b/Assets/Tests/Editor/DynamicCodeToolTests/DynamicCodeExecutorPoolTests.cs @@ -130,11 +130,6 @@ public Task ExecuteCodeAsync( }); } - public ExecutionStatistics GetStatistics() - { - return new ExecutionStatistics(); - } - public void Dispose() { DisposeCallCount++; diff --git a/Assets/Tests/Editor/MouseUiMainThreadCleanupSchedulerTests.cs b/Assets/Tests/Editor/MouseUiMainThreadCleanupSchedulerTests.cs index c368686845..da92345938 100644 --- a/Assets/Tests/Editor/MouseUiMainThreadCleanupSchedulerTests.cs +++ b/Assets/Tests/Editor/MouseUiMainThreadCleanupSchedulerTests.cs @@ -43,7 +43,6 @@ public void QueueOverlayClear_WithActiveOverlayState_ClearsState() MouseAction.Click, new Vector2(10f, 20f), null, - "Target", new Vector2(100f, 200f)); MouseUiMainThreadCleanupScheduler scheduler = new(); scheduler.CaptureMainThreadContext(); diff --git a/Packages/src/Editor/Application/CliSetupApplicationService.cs b/Packages/src/Editor/Application/CliSetupApplicationService.cs index a7ed8b9d66..420f2014ab 100644 --- a/Packages/src/Editor/Application/CliSetupApplicationService.cs +++ b/Packages/src/Editor/Application/CliSetupApplicationService.cs @@ -155,11 +155,6 @@ public Task IsCliVisibleFromShellAsync(RuntimePlatform platform, Cancellat return _cliInstallationDetector.IsCliVisibleFromShellAsync(platform, ct); } - public void InvalidateCliCache() - { - _cliInstallationDetector.InvalidateCache(); - } - public string GetMinimumRequiredCliVersion() { // Why: v3 setup installs the global dispatcher and reads the minimum from the package pin JSON @@ -179,26 +174,6 @@ public bool HasPackageOwnedCurrentUserInstall(RuntimePlatform platform) return _nativeCliInstaller.HasPackageOwnedCurrentUserInstall(platform); } - public bool IsCliVersionLessThan(string leftVersion, string rightVersion) - { - return CliVersionComparer.IsVersionLessThan(leftVersion, rightVersion); - } - - public bool IsCliVersionGreaterThan(string leftVersion, string rightVersion) - { - return CliVersionComparer.IsVersionGreaterThan(leftVersion, rightVersion); - } - - public bool IsCliVersionGreaterThanOrEqual(string leftVersion, string rightVersion) - { - return CliVersionComparer.IsVersionGreaterThanOrEqual(leftVersion, rightVersion); - } - - public bool IsCliVersionEqual(string leftVersion, string rightVersion) - { - return CliVersionComparer.IsVersionEqual(leftVersion, rightVersion); - } - public async Task InstallGlobalCliAsync( RuntimePlatform platform, IProgress installProgress, diff --git a/Packages/src/Editor/Application/UnityCliLoopServerApplicationService.cs b/Packages/src/Editor/Application/UnityCliLoopServerApplicationService.cs index 36576a9527..ef8bc231b7 100644 --- a/Packages/src/Editor/Application/UnityCliLoopServerApplicationService.cs +++ b/Packages/src/Editor/Application/UnityCliLoopServerApplicationService.cs @@ -61,10 +61,6 @@ public interface IUnityCliLoopServerController void AddServerStateChangedHandler(Action handler); void RemoveServerStateChangedHandler(Action handler); - - void AddServerStartedHandler(Action handler); - - void RemoveServerStartedHandler(Action handler); } /// @@ -235,15 +231,5 @@ public void RemoveServerStateChangedHandler(Action handler) { _controller.RemoveServerStateChangedHandler(handler); } - - public void AddServerStartedHandler(Action handler) - { - _controller.AddServerStartedHandler(handler); - } - - public void RemoveServerStartedHandler(Action handler) - { - _controller.RemoveServerStartedHandler(handler); - } } } diff --git a/Packages/src/Editor/Application/UnityCliLoopToolRegistrar.cs b/Packages/src/Editor/Application/UnityCliLoopToolRegistrar.cs index 4616321dc0..edb28f4532 100644 --- a/Packages/src/Editor/Application/UnityCliLoopToolRegistrar.cs +++ b/Packages/src/Editor/Application/UnityCliLoopToolRegistrar.cs @@ -142,16 +142,6 @@ internal static void RegisterService(UnityCliLoopToolRegistrarService service) ServiceValue = service ?? throw new ArgumentNullException(nameof(service)); } - internal static void AddToolsChangedHandler(Action handler) - { - Service.OnToolsChanged += handler; - } - - internal static void RemoveToolsChangedHandler(Action handler) - { - Service.OnToolsChanged -= handler; - } - public static UnityCliLoopToolRegistrarService Service { get @@ -184,20 +174,5 @@ public static bool IsCustomToolRegistered(string toolName) { return Service.IsCustomToolRegistered(toolName); } - - public static UnityCliLoopToolRegistry TryGetRegistry() - { - return Service.TryGetRegistry(); - } - - public static string GetDebugInfo() - { - return Service.GetDebugInfo(); - } - - public static void NotifyToolChanges() - { - Service.NotifyToolChanges(); - } } } diff --git a/Packages/src/Editor/Application/UnityCliLoopUIConstants.cs b/Packages/src/Editor/Application/UnityCliLoopUIConstants.cs index 1af521aeef..9cfb0c7925 100644 --- a/Packages/src/Editor/Application/UnityCliLoopUIConstants.cs +++ b/Packages/src/Editor/Application/UnityCliLoopUIConstants.cs @@ -8,7 +8,6 @@ public static class UnityCliLoopUIConstants { // Tool Settings public const string TOOL_SETTINGS_MENU_PATH = "Window > Unity CLI Loop > Settings"; - public const string CLI_COMMAND_REFERENCE_URL = "https://github.com/hatayama/unity-cli-loop#direct-cli-usage-advanced"; public const string PROJECT_REPOSITORY_URL = "https://github.com/hatayama/unity-cli-loop"; } } diff --git a/Packages/src/Editor/Application/UseCases/ThirdPartyToolMigrationUseCase.cs b/Packages/src/Editor/Application/UseCases/ThirdPartyToolMigrationUseCase.cs index 43a018c3ae..4fe24a0029 100644 --- a/Packages/src/Editor/Application/UseCases/ThirdPartyToolMigrationUseCase.cs +++ b/Packages/src/Editor/Application/UseCases/ThirdPartyToolMigrationUseCase.cs @@ -22,13 +22,6 @@ public ThirdPartyToolMigrationUseCase(IThirdPartyToolMigrationPort migrationPort _migrationPort = migrationPort ?? throw new ArgumentNullException(nameof(migrationPort)); } - public ThirdPartyToolMigrationPreview PreviewMigration(string projectRoot) - { - Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty"); - - return _migrationPort.PreviewMigration(projectRoot); - } - public Task PreviewMigrationAsync( string projectRoot, IProgress progress, @@ -55,13 +48,6 @@ public Task HasMigrationTargetsAsync(string projectRoot, CancellationToken return _migrationPort.HasMigrationTargetsAsync(projectRoot, ct); } - public ThirdPartyToolMigrationResult ApplyMigration(string projectRoot) - { - Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty"); - - return _migrationPort.ApplyMigration(projectRoot); - } - public Task ApplyMigrationAsync( string projectRoot, IProgress progress, diff --git a/Packages/src/Editor/Domain/CliConstants.cs b/Packages/src/Editor/Domain/CliConstants.cs index 90289497ba..7ecd6cfb91 100644 --- a/Packages/src/Editor/Domain/CliConstants.cs +++ b/Packages/src/Editor/Domain/CliConstants.cs @@ -32,14 +32,11 @@ public static class CliConstants public const string POSIX_PATH_SEPARATOR = ":"; public const string WINDOWS_PATH_SEPARATOR = ";"; public const string DISPATCHER_RELEASE_TAG_PREFIX = "dispatcher-v"; - public const string BETA_VERSION_MARKER = "-beta."; public const string SKILL_DIR_PREFIX = "uloop-"; public const string TEMPORARY_SKILLS_DIR_NAME = "TemporarySkills~"; public const string V3_CLI_INVOCATION_MIGRATION_SKILL_NAME = "v3-cli-invocation-migration"; public const string UNITY_PACKAGES_DIR_NAME = "Packages"; public const string PACKAGE_SOURCE_DIR_NAME = "src"; - public const string CLI_LAYOUT_CONTRACT_FILE_NAME = "layout-contract.json"; - public const string CLI_CONTRACT_FILE_NAME = "contract.json"; public const string GLOBAL_UNIX_COMMAND_NAME = EXECUTABLE_NAME; public const string GLOBAL_WINDOWS_COMMAND_NAME = EXECUTABLE_NAME + ".exe"; } diff --git a/Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs b/Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs index 8745fd0e03..af2e5c11c2 100644 --- a/Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs +++ b/Packages/src/Editor/Domain/IUnityCliLoopEditorSettingsPort.cs @@ -12,10 +12,8 @@ public interface IUnityCliLoopEditorSettingsPort void SaveSettings(UnityCliLoopEditorSettingsData settings); void UpdateSettings(Func transform); string GetLastSeenSetupWizardVersion(); - void SetLastSeenSetupWizardVersion(string version); bool GetSuppressSetupWizardAutoShow(); void SetSuppressSetupWizardAutoShow(bool suppressAutoShow); - void SetShowUnityCliLoopSecuritySetting(bool showUnityCliLoopSecuritySetting); void SetShowToolSettings(bool showToolSettings); void SetInstallSkillsFlat(bool installSkillsFlat); } diff --git a/Packages/src/Editor/Domain/ThirdPartyToolMigrationApiDetectionRules.cs b/Packages/src/Editor/Domain/ThirdPartyToolMigrationApiDetectionRules.cs index 343ebeae47..78cbfdbc6c 100644 --- a/Packages/src/Editor/Domain/ThirdPartyToolMigrationApiDetectionRules.cs +++ b/Packages/src/Editor/Domain/ThirdPartyToolMigrationApiDetectionRules.cs @@ -188,32 +188,6 @@ public static bool ContainsCurrentToolContractsApi(string source) return RegexMatchesCode(source, CurrentToolContractsNamespaceRegex); } - public static bool ContainsLegacyDomainMetadataApi(string source) - { - Debug.Assert(source != null, "source must not be null"); - - return RegexMatchesCode(source, LegacyDomainMetadataRegex) || - ContainsLegacyDomainHelperApiForAssembly( - source, - hasLegacyAssemblySource: ContainsLegacyToolMigrationMarker(source), - legacyAssemblyAliases: Array.Empty()); - } - - public static bool ContainsLegacyDomainHelperApiForAssembly( - string source, - bool hasLegacyAssemblySource, - string[] legacyAssemblyAliases) - { - Debug.Assert(source != null, "source must not be null"); - Debug.Assert(legacyAssemblyAliases != null, "legacyAssemblyAliases must not be null"); - - string[] legacyNamespaceAliases = GetCombinedLegacyNamespaceAliases(source, legacyAssemblyAliases); - return ContainsLegacyDomainHelperReference( - source, - hasLegacyAssemblySource, - legacyNamespaceAliases); - } - public static bool ContainsCurrentDomainMetadataApi(string source) { Debug.Assert(source != null, "source must not be null"); @@ -326,19 +300,6 @@ public static bool ContainsLegacyEditorWindowCaptureUtilityTimeoutMigrationForAs requiresTimeoutArgumentMigration: true); } - public static bool ContainsCurrentFirstPartyScreenshotApi(string source) - { - Debug.Assert(source != null, "source must not be null"); - - bool hasCurrentFirstPartyToolsNamespaceUsage = - RegexMatchesCode(source, CurrentFirstPartyToolsNamespaceRegex); - return ContainsCurrentFirstPartyScreenshotApiForAssembly( - source, - hasCurrentFirstPartyToolsNamespaceUsage, - Array.Empty(), - Array.Empty()); - } - public static bool ContainsCurrentFirstPartyScreenshotApiForAssembly( string source, bool hasAssemblyScopedCurrentFirstPartyToolsUsing, diff --git a/Packages/src/Editor/Domain/ThirdPartyToolMigrationDomainDetectionRules.cs b/Packages/src/Editor/Domain/ThirdPartyToolMigrationDomainDetectionRules.cs index 45ce468179..af7d5e02a0 100644 --- a/Packages/src/Editor/Domain/ThirdPartyToolMigrationDomainDetectionRules.cs +++ b/Packages/src/Editor/Domain/ThirdPartyToolMigrationDomainDetectionRules.cs @@ -158,51 +158,6 @@ public static bool ContainsMigratableUnqualifiedLegacyRegistrarDomainReturn(stri return false; } - public static bool ContainsLegacyDomainHelperReference( - string source, - bool canMigrateBareLegacyDomainHelper, - string[] aliases) - { - Debug.Assert(source != null, "source must not be null"); - Debug.Assert(aliases != null, "aliases must not be null"); - - CodeTextMask codeTextMask = CodeTextMask.Create(source); - foreach (TypeReplacementRule rule in DomainTypeReplacementRules) - { - Regex fullyQualifiedRegex = new( - $@"(?:(?:global::)?{Regex.Escape(LegacyNamespace)}\.){Regex.Escape(rule.LegacyName)}\b", - RegexOptions.Compiled); - if (RegexMatchesCode(source, fullyQualifiedRegex)) - { - return true; - } - - foreach (string alias in aliases) - { - if (ContainsAliasQualifiedName(source, alias, rule.LegacyName)) - { - return true; - } - } - - if (canMigrateBareLegacyDomainHelper && - ContainsLegacyAssemblyScopedTypeName(source, codeTextMask, rule.LegacyName)) - { - return true; - } - } - - return false; - } - - public static bool ContainsCurrentDomainHelperApi(string source) - { - Debug.Assert(source != null, "source must not be null"); - - bool hasCurrentDomainNamespaceUsage = RegexMatchesCode(source, CurrentDomainNamespaceRegex); - return ContainsCurrentDomainHelperApiForAssembly(source, hasCurrentDomainNamespaceUsage); - } - public static bool ContainsCurrentDomainHelperApiForAssembly( string source, bool canUseBareCurrentDomainType) diff --git a/Packages/src/Editor/Domain/ThirdPartyToolMigrationRuleCatalog.cs b/Packages/src/Editor/Domain/ThirdPartyToolMigrationRuleCatalog.cs index 632be3cfff..9590c30a86 100644 --- a/Packages/src/Editor/Domain/ThirdPartyToolMigrationRuleCatalog.cs +++ b/Packages/src/Editor/Domain/ThirdPartyToolMigrationRuleCatalog.cs @@ -33,7 +33,6 @@ public static class ThirdPartyToolMigrationRuleCatalog public const string DescriptionAttributeArgumentName = "Description"; public const string DisplayDevelopmentOnlyAttributeArgumentName = "DisplayDevelopmentOnly"; public const string RequiredSecuritySettingAttributeArgumentName = "RequiredSecuritySetting"; - public const string LegacySecuritySettingsTypeName = "SecuritySettings"; public const string CurrentSecuritySettingTypeName = "UnityCliLoopSecuritySetting"; public const string LegacyEditorDelayTypeName = "EditorDelay"; public const string LegacyEditorDelayMethodName = "DelayFrame"; diff --git a/Packages/src/Editor/FirstPartyTools/ClearConsole/ClearConsoleResponse.cs b/Packages/src/Editor/FirstPartyTools/ClearConsole/ClearConsoleResponse.cs index aad42ab50f..d402b3bb7a 100644 --- a/Packages/src/Editor/FirstPartyTools/ClearConsole/ClearConsoleResponse.cs +++ b/Packages/src/Editor/FirstPartyTools/ClearConsole/ClearConsoleResponse.cs @@ -41,28 +41,6 @@ public ClearConsoleResponse(bool success, int clearedLogCount, ClearedLogCounts Message = message ?? string.Empty; ErrorMessage = string.Empty; } - - /// - /// Create a new ClearConsoleResponse for failed operation - /// - public ClearConsoleResponse(string errorMessage) - { - Success = false; - ClearedLogCount = 0; - ClearedCounts = new ClearedLogCounts(); - Message = string.Empty; - ErrorMessage = errorMessage ?? string.Empty; - } - - /// - /// Parameterless constructor for JSON deserialization - /// - public ClearConsoleResponse() - { - ClearedCounts = new ClearedLogCounts(); - Message = string.Empty; - ErrorMessage = string.Empty; - } } /// diff --git a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputRecorder.cs b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputRecorder.cs index c54965dd95..965e2bca20 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputRecorder.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputRecorder.cs @@ -234,11 +234,6 @@ public static void NotifyRecordingStopped() ServiceValue.NotifyRecordingStopped(); } - public static void ForceStop() - { - ServiceValue.ForceStop(); - } - internal static string FormatVector2(Vector2 v) { return InputRecordingVectorFormat.FormatVector2(v); diff --git a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputReplayUiController.cs b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputReplayUiController.cs index 6f53820fcd..06757fec26 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputReplayUiController.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputReplayUiController.cs @@ -83,7 +83,6 @@ private void ApplyUiPointerActivity(UiReplayFrame replayFrame) MouseAction.Click, replayFrame.InputPosition, null, - _currentPressTarget?.name, replayFrame.GameViewSize); SimulateMouseUiOverlayState.RequestExpandAnimation(); return; @@ -104,7 +103,6 @@ private void ApplyUiPointerActivity(UiReplayFrame replayFrame) MouseAction.Click, replayFrame.InputPosition, null, - null, replayFrame.GameViewSize); } } @@ -122,7 +120,6 @@ private void ApplyUiPointerHold(UiReplayFrame replayFrame) MouseAction.Drag, replayFrame.InputPosition, pressInputPos, - null, replayFrame.GameViewSize); return; } @@ -137,7 +134,6 @@ private void ApplyUiPointerHold(UiReplayFrame replayFrame) MouseAction.LongPress, replayFrame.InputPosition, null, - _currentPressTarget?.name, replayFrame.GameViewSize); SimulateMouseUiOverlayState.UpdateLongPressElapsed(elapsed); } diff --git a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs index ea15937d08..356af9dc14 100644 --- a/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs +++ b/Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs @@ -18,14 +18,6 @@ internal static class UiRaycastHelper return context.Raycast(screenPosition); } - // Bypass EventSystem's Screen-bounds clipping by directly testing Graphic rects in Canvas space. - // Only supports ScreenSpaceOverlay canvases where world positions equal Canvas-space positions. - public static RaycastResult? RaycastCanvasSpace(Vector2 canvasPosition) - { - List canvasRaycastSources = CollectCanvasRaycastSources(); - return RaycastCanvasSpaceFromSources(canvasPosition, canvasRaycastSources); - } - private static List CollectCanvasRaycastSources() { #if UNITY_6000_4_OR_NEWER diff --git a/Packages/src/Editor/FirstPartyTools/Compile/AssemblyDefinitionDuplicationValidationService.cs b/Packages/src/Editor/FirstPartyTools/Compile/AssemblyDefinitionDuplicationValidationService.cs index 264a639e38..28a8ac3091 100644 --- a/Packages/src/Editor/FirstPartyTools/Compile/AssemblyDefinitionDuplicationValidationService.cs +++ b/Packages/src/Editor/FirstPartyTools/Compile/AssemblyDefinitionDuplicationValidationService.cs @@ -4,7 +4,6 @@ using System.Text.RegularExpressions; using UnityEditor; using UnityEditorInternal; -using UnityEngine; using io.github.hatayama.UnityCliLoop.ToolContracts; @@ -18,88 +17,6 @@ public class AssemblyDefinitionDuplicationValidationService private static readonly Regex AsmdefNameRegex = new("\"name\"\\s*:\\s*\"(?[^\"]+)\"", RegexOptions.Compiled); - private static readonly Regex DuplicateAsmdefConsoleRegex = new( - "^Assembly with name '(?[^']+)' already exists \\((?[^)]+)\\)$", - RegexOptions.Compiled - ); - - public ValidationResult ValidateNoDuplicateAsmdefNamesFromConsoleErrors() - { - LogRetrievalService retrievalService = new(); - LogDisplayDto logData = retrievalService.GetLogsWithSearch( - UnityCliLoopLogType.Error, - "Assembly with name '", - useRegex: false, - searchInStackTrace: false - ); - - Dictionary> pathsByAsmName = new(StringComparer.Ordinal); - - foreach (LogEntryDto entry in logData.LogEntries) - { - if (string.IsNullOrEmpty(entry.Message)) - { - continue; - } - - Match match = DuplicateAsmdefConsoleRegex.Match(entry.Message.Trim()); - if (!match.Success) - { - continue; - } - - string asmName = match.Groups["name"].Value; - string assetPath = match.Groups["path"].Value; - if (string.IsNullOrEmpty(asmName) || string.IsNullOrEmpty(assetPath)) - { - continue; - } - - // Prevent false positives from stale console logs by verifying the asset still exists. - UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(assetPath); - if (obj == null) - { - continue; - } - - if (!pathsByAsmName.TryGetValue(asmName, out List paths)) - { - paths = new List(); - pathsByAsmName.Add(asmName, paths); - } - - if (!paths.Contains(assetPath)) - { - paths.Add(assetPath); - } - } - - if (pathsByAsmName.Count == 0) - { - return ValidationResult.Success(); - } - - string details = string.Join( - "\n", - pathsByAsmName - .OrderBy(kvp => kvp.Key, StringComparer.Ordinal) - .Take(5) - .Select(d => - { - string paths = string.Join("\n ", d.Value.Take(8)); - return $"- {d.Key}\n {paths}"; - }) - ); - - string message = - $"{UnityCliLoopConstants.ERROR_MESSAGE_DUPLICATE_ASMDEF}\n" + - "Detected from Console errors:\n" + - $"{details}\n" + - "Fix: ensure each .asmdef has a unique \"name\"."; - - return ValidationResult.Failure(message); - } - public ValidationResult ValidateNoDuplicateAsmdefNames() { string[] asmdefGuids = AssetDatabase.FindAssets("t:AssemblyDefinitionAsset"); diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationRequest.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationRequest.cs index 19d330131f..489598c0c7 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationRequest.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationRequest.cs @@ -38,9 +38,6 @@ public class CompilationRequest /// public enum AssemblyLoadingMode { - /// Reference only selected assemblies - SelectiveReference, - /// Add all assemblies AllAssemblies } diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationResult.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationResult.cs index 84496c6e89..e22fa95522 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationResult.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/CompilationResult.cs @@ -63,12 +63,6 @@ public enum CompilationFailureReason None, /// Compilation Error - CompilationError, - - /// Dynamic Assembly Addition Failed - DynamicAssemblyFailed, - - /// Using Statement Addition Failed - UsingStatementFailed + CompilationError } } diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs index dc0d5979af..c6de905c4b 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Compilation/DynamicCompilationHealthMonitor.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Threading; using UnityEngine; using io.github.hatayama.UnityCliLoop.ToolContracts; @@ -13,7 +12,6 @@ public static class DynamicCompilationHealthMonitor { private static readonly object ReportedIssueLock = new(); private static readonly HashSet ReportedIssues = new(System.StringComparer.Ordinal); - private static readonly AsyncLocal ConsoleDiagnosticSource = new(); public static void ReportFastPathUnavailable( string editorPath, @@ -91,11 +89,9 @@ private static void LogErrorOnce( string humanNote, string aiTodo) { - string effectiveIssueKey = CreateEffectiveIssueKey(issueKey); - lock (ReportedIssueLock) { - if (!ReportedIssues.Add(effectiveIssueKey)) + if (!ReportedIssues.Add(issueKey)) { return; } @@ -116,11 +112,9 @@ private static void LogInfoOnce( string message, object context) { - string effectiveIssueKey = CreateEffectiveIssueKey(issueKey); - lock (ReportedIssueLock) { - if (!ReportedIssues.Add(effectiveIssueKey)) + if (!ReportedIssues.Add(issueKey)) { return; } @@ -129,75 +123,17 @@ private static void LogInfoOnce( VibeLogger.LogInfo(operation, message, context); } - private static string CreateEffectiveIssueKey(string issueKey) - { - Debug.Assert(!string.IsNullOrEmpty(issueKey), "issueKey must not be empty"); - - if (string.IsNullOrEmpty(ConsoleDiagnosticSource.Value)) - { - return issueKey; - } - - return $"{issueKey}::source::{ConsoleDiagnosticSource.Value}"; - } - - internal static System.IDisposable UseConsoleDiagnosticSource(string source) - { - if (string.IsNullOrEmpty(source)) - { - return EmptyDisposable.Instance; - } - - string previousSource = ConsoleDiagnosticSource.Value; - ConsoleDiagnosticSource.Value = source; - return new ConsoleDiagnosticSourceScope(previousSource); - } - private static string FormatConsoleErrorMessage(string operation, string message, object context) { Debug.Assert(!string.IsNullOrEmpty(operation), "operation must not be empty"); Debug.Assert(!string.IsNullOrEmpty(message), "message must not be empty"); - string diagnosticSourceLine = string.IsNullOrEmpty(ConsoleDiagnosticSource.Value) - ? string.Empty - : $"\ndiagnostic_source: {ConsoleDiagnosticSource.Value}"; - if (context == null) { - return $"[{UnityCliLoopConstants.PROJECT_NAME}] {message}\noperation: {operation}{diagnosticSourceLine}"; + return $"[{UnityCliLoopConstants.PROJECT_NAME}] {message}\noperation: {operation}"; } - return $"[{UnityCliLoopConstants.PROJECT_NAME}] {message}\noperation: {operation}{diagnosticSourceLine}\ncontext: {context}"; - } - - /// - /// Provides Console Diagnostic Source Scope behavior for Unity CLI Loop. - /// - private sealed class ConsoleDiagnosticSourceScope : System.IDisposable - { - private readonly string _previousSource; - - public ConsoleDiagnosticSourceScope(string previousSource) - { - _previousSource = previousSource; - } - - public void Dispose() - { - ConsoleDiagnosticSource.Value = _previousSource; - } - } - - /// - /// Provides Empty Disposable behavior for Unity CLI Loop. - /// - private sealed class EmptyDisposable : System.IDisposable - { - public static readonly EmptyDisposable Instance = new EmptyDisposable(); - - public void Dispose() - { - } + return $"[{UnityCliLoopConstants.PROJECT_NAME}] {message}\noperation: {operation}\ncontext: {context}"; } internal static void ResetForTests() @@ -206,8 +142,6 @@ internal static void ResetForTests() { ReportedIssues.Clear(); } - - ConsoleDiagnosticSource.Value = null; } } } diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCodeServices.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCodeServices.cs index d008753e1d..ed735c44b2 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCodeServices.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCodeServices.cs @@ -204,21 +204,11 @@ internal static DynamicCodeServicesRegistry GetRegistry() return RegistryValue; } - internal static IDynamicCodeSourcePreparationService SourcePreparationService - { - get { return GetRegistry().SourcePreparationService; } - } - internal static CompiledCommandEntryPointResolver CommandEntryPointResolver { get { return GetRegistry().CommandEntryPointResolver; } } - internal static RegistryDynamicCodeExecutorFactory ExecutorFactory - { - get { return GetRegistry().ExecutorFactory; } - } - internal static IExecuteDynamicCodeUseCase GetExecuteDynamicCodeUseCase() { return GetRegistry().GetExecuteDynamicCodeUseCase(); diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCompilationTimingFormatter.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCompilationTimingFormatter.cs index c23d089e78..4fd7fdefee 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCompilationTimingFormatter.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/DynamicCompilationTimingFormatter.cs @@ -7,8 +7,6 @@ namespace io.github.hatayama.UnityCliLoop.FirstPartyTools /// internal static class DynamicCompilationTimingFormatter { - private const string CacheHitTimingEntry = "[Perf] CacheHit: true"; - public static List CreateCompilationTimings( double referenceResolutionMilliseconds, double buildMilliseconds, @@ -30,14 +28,6 @@ public static List CreateCompilationTimings( return timings; } - public static List CreateCachedCompilationTimings( - DynamicCompilationBackendKind backendKind = DynamicCompilationBackendKind.Unknown) - { - List timings = CreateCompilationTimings(0, 0, 0, backendKind); - timings.Add(CacheHitTimingEntry); - return timings; - } - private static string CreateBackendTimingEntry(DynamicCompilationBackendKind backendKind) { return backendKind switch diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs index 79a9fd5823..f0cd66908a 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/SharedRoslynCompilerWorkerHost.cs @@ -265,11 +265,6 @@ internal static void ShutdownForServerReset() Shutdown(); } - internal static Action SwapCompileRequestSenderForTests(Action sender) - { - return ServiceValue.SwapCompileRequestSenderForTests(sender); - } - internal static Func SwapWorkerAssemblyCompilerForTests( Func compiler) @@ -277,11 +272,6 @@ internal static Func _startProcess = ProcessStartHelper.TryStart; - private Action _sendCompileRequest = SendCompileRequestCore; private Func _compileWorkerAssemblyForTests; private Process _workerProcess; @@ -70,16 +69,6 @@ internal int ResponseTimeoutMilliseconds } } - internal void SetResponseTimeoutMillisecondsForTests(int timeoutMilliseconds) - { - Debug.Assert(timeoutMilliseconds > 0, "timeoutMilliseconds must be positive"); - - _coordination.ExecuteWithStateLock(() => - { - _responseTimeoutMilliseconds = timeoutMilliseconds; - }); - } - internal bool HasLiveProcessLocked() { AssertStateLockHeld(); @@ -114,7 +103,7 @@ internal bool StartProcessLocked(ProcessStartInfo startInfo) internal void SendCompileRequestLocked(string requestFilePath) { AssertStateLockHeld(); - _sendCompileRequest(_workerProcess, requestFilePath); + SendCompileRequestCore(_workerProcess, requestFilePath); } internal StreamReader GetOutputReaderLocked() @@ -332,15 +321,6 @@ internal Func SwapProcessStarterForTests( return previous; } - internal Action SwapCompileRequestSenderForTests(Action sender) - { - Debug.Assert(sender != null, "sender must not be null"); - - Action previous = _sendCompileRequest; - _sendCompileRequest = sender; - return previous; - } - internal Func SwapWorkerAssemblyCompilerForTests( Func compiler) diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/ExecuteDynamicCodeResponse.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/ExecuteDynamicCodeResponse.cs index 3f4b3d5290..78d5e46200 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/ExecuteDynamicCodeResponse.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/ExecuteDynamicCodeResponse.cs @@ -23,14 +23,17 @@ public class ExecuteDynamicCodeResponse : UnityCliLoopToolResponse, IUnityCliLoo /// Error message (on failure) public string ErrorMessage { get; set; } - - /// Error message (alias for ErrorMessage) - public string Error - { - get => ErrorMessage; - set => ErrorMessage = value; + + /// + /// Error message alias for ErrorMessage. + /// Why keep: documented tool-response JSON field (Skill/SKILL.md); agents and CLI read it. + /// + public string Error + { + get => ErrorMessage; + set => ErrorMessage = value; } - + /// /// Code formatted for compilation /// (After extracting/moving using statements and applying class/method wrapping) diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunner.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunner.cs index f990998b67..618f9ea9e3 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunner.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunner.cs @@ -58,11 +58,6 @@ private CancellationTokenSource CreateCombinedCancellationTokenSource( ); } - public void Cancel() - { - _executionSlot.Cancel(); - } - public async Task ExecuteAsync(ExecutionContext context) { string correlationId = UnityCliLoopConstants.GenerateCorrelationId(); diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunnerExecutionSlot.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunnerExecutionSlot.cs index cbf7270e20..44a1a06507 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunnerExecutionSlot.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/CommandRunnerExecutionSlot.cs @@ -39,11 +39,6 @@ public bool TryBegin( return true; } - public void Cancel() - { - _cancellationTokenSource?.Cancel(); - } - /// /// Ends the execution slot even when undo collapse throws. /// Why nested finally: collapse can throw on a torn-down editor; the running flag must clear. diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutor.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutor.cs index a6de8cbf92..080664e10a 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutor.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutor.cs @@ -16,15 +16,6 @@ internal sealed class DynamicCodeExecutor : IDynamicCodeExecutor private readonly IDynamicCompilationService _compiler; private readonly ICompiledCommandInvoker _invoker; private readonly IDynamicCodeSourcePreparationService _sourcePreparationService; - private readonly ExecutionStatistics _statistics; - private readonly object _statsLock = new(); - - public DynamicCodeExecutor( - IDynamicCompilationService compiler, - ICompiledCommandInvoker invoker) - : this(compiler, invoker, DynamicCodeServices.SourcePreparationService) - { - } internal DynamicCodeExecutor( IDynamicCompilationService compiler, @@ -34,7 +25,6 @@ internal DynamicCodeExecutor( _compiler = compiler ?? throw new ArgumentNullException(nameof(compiler)); _invoker = invoker ?? throw new ArgumentNullException(nameof(invoker)); _sourcePreparationService = sourcePreparationService ?? throw new ArgumentNullException(nameof(sourcePreparationService)); - _statistics = new ExecutionStatistics(); } public async Task ExecuteCodeAsync( @@ -103,39 +93,20 @@ public async Task ExecuteCodeAsync( compileTotalStopwatch.Elapsed.TotalMilliseconds); AppendCompilationAdvisories(executionResult.Logs, compilationResult.AdvisoryLogs); - UpdateStatistics(executionResult, totalStopwatch.Elapsed); return executionResult; } catch (OperationCanceledException) { - ExecutionResult cancelledResult = CreateCancelledResult(totalStopwatch.Elapsed); - UpdateStatistics(cancelledResult, totalStopwatch.Elapsed); - return cancelledResult; + return CreateCancelledResult(totalStopwatch.Elapsed); } catch (Exception ex) { ExecutionResult failureResult = CreateUnexpectedErrorResult(ex, totalStopwatch.Elapsed); - UpdateStatistics(failureResult, totalStopwatch.Elapsed); LogUnexpectedExecutionException(ex, correlationId, totalStopwatch.ElapsedMilliseconds); return failureResult; } } - public ExecutionStatistics GetStatistics() - { - lock (_statsLock) - { - return new ExecutionStatistics - { - TotalExecutions = _statistics.TotalExecutions, - SuccessfulExecutions = _statistics.SuccessfulExecutions, - FailedExecutions = _statistics.FailedExecutions, - AverageExecutionTime = _statistics.AverageExecutionTime, - CompilationErrors = _statistics.CompilationErrors - }; - } - } - public void Dispose() { if (_compiler is IDisposable disposableCompiler) @@ -155,16 +126,7 @@ private async Task CompileCodeAsync( Namespace = DynamicCodeConstants.DEFAULT_NAMESPACE }; - CompilationResult result = await _compiler.CompileAsync(request, ct).ConfigureAwait(false); - if (!result.Success) - { - lock (_statsLock) - { - _statistics.CompilationErrors++; - } - } - - return result; + return await _compiler.CompileAsync(request, ct).ConfigureAwait(false); } private ExecutionResult TryCreateCompilationFailureResult( @@ -266,28 +228,6 @@ private static void AppendCompilationAdvisories( destination.AddRange(advisoryLogs); } - private void UpdateStatistics(ExecutionResult result, TimeSpan executionTime) - { - lock (_statsLock) - { - _statistics.TotalExecutions++; - if (result.Success) - { - _statistics.SuccessfulExecutions++; - } - else - { - _statistics.FailedExecutions++; - } - - double totalMilliseconds = - _statistics.AverageExecutionTime.TotalMilliseconds * (_statistics.TotalExecutions - 1); - totalMilliseconds += executionTime.TotalMilliseconds; - _statistics.AverageExecutionTime = - TimeSpan.FromMilliseconds(totalMilliseconds / _statistics.TotalExecutions); - } - } - private static Dictionary BuildExecutionParameters( object[] parameters, IReadOnlyCollection hoistedLiteralBindings) diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutorStub.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutorStub.cs index 0d8184c780..9ccfa8ea0e 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutorStub.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution/DynamicCodeExecutorStub.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -11,13 +10,6 @@ namespace io.github.hatayama.UnityCliLoop.FirstPartyTools /// public class DynamicCodeExecutorStub : IDynamicCodeExecutor { - private readonly ExecutionStatistics _statistics; - - public DynamicCodeExecutorStub() - { - _statistics = new ExecutionStatistics(); - } - /// Execute code asynchronously (always returns a Roslyn required error) public Task ExecuteCodeAsync( string code, @@ -29,19 +21,6 @@ public Task ExecuteCodeAsync( return Task.FromResult(CreateCompilationProviderUnavailableResult()); } - /// Retrieve execution statistics - public ExecutionStatistics GetStatistics() - { - return new ExecutionStatistics - { - TotalExecutions = _statistics.TotalExecutions, - SuccessfulExecutions = _statistics.SuccessfulExecutions, - FailedExecutions = _statistics.FailedExecutions, - AverageExecutionTime = _statistics.AverageExecutionTime, - CompilationErrors = _statistics.CompilationErrors - }; - } - public void Dispose() { } @@ -52,8 +31,7 @@ private ExecutionResult CreateCompilationProviderUnavailableResult() { Success = false, ErrorMessage = "COMPILATION_PROVIDER_UNAVAILABLE: No compilation provider is registered. Check initialization.", - ExecutionTime = TimeSpan.Zero, - Statistics = _statistics + ExecutionTime = TimeSpan.Zero }; } } diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/IDynamicCodeExecutor.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/IDynamicCodeExecutor.cs index fdbc51c2e3..da8e88f319 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/IDynamicCodeExecutor.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/IDynamicCodeExecutor.cs @@ -17,28 +17,5 @@ System.Threading.Tasks.Task ExecuteCodeAsync( CancellationToken cancellationToken = default, bool compileOnly = false ); - - - - ExecutionStatistics GetStatistics(); - } - - /// Execution statistics - public class ExecutionStatistics - { - /// Total execution count - public int TotalExecutions { get; set; } - - /// Successful execution count - public int SuccessfulExecutions { get; set; } - - /// Failed execution count - public int FailedExecutions { get; set; } - - /// Average execution time - public TimeSpan AverageExecutionTime { get; set; } - - /// Compilation error count - public int CompilationErrors { get; set; } } } diff --git a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Models/ExecutionResult.cs b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Models/ExecutionResult.cs index 485005b6bb..037a4b5d23 100644 --- a/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Models/ExecutionResult.cs +++ b/Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Models/ExecutionResult.cs @@ -28,9 +28,6 @@ public class ExecutionResult /// Logs public List Logs { get; set; } = new(); - /// Execution Statistics - public ExecutionStatistics Statistics { get; set; } - /// /// Structured compilation errors when compilation failed. /// Preserved to enable rich diagnostics formatting at the tool layer. diff --git a/Packages/src/Editor/FirstPartyTools/FindGameObjects/GameObjectFinder/GameObjectDetails.cs b/Packages/src/Editor/FirstPartyTools/FindGameObjects/GameObjectFinder/GameObjectDetails.cs index 4c47188e8b..5999d46370 100644 --- a/Packages/src/Editor/FirstPartyTools/FindGameObjects/GameObjectFinder/GameObjectDetails.cs +++ b/Packages/src/Editor/FirstPartyTools/FindGameObjects/GameObjectFinder/GameObjectDetails.cs @@ -8,7 +8,6 @@ namespace io.github.hatayama.UnityCliLoop.FirstPartyTools public class GameObjectDetails { public bool Found { get; set; } - public string ErrorMessage { get; set; } public GameObject GameObject { get; set; } public string Name { get; set; } public string Path { get; set; } diff --git a/Packages/src/Editor/FirstPartyTools/GetLogs/GetLogsResponse.cs b/Packages/src/Editor/FirstPartyTools/GetLogs/GetLogsResponse.cs index 9b9f232816..a5dc1d8d19 100644 --- a/Packages/src/Editor/FirstPartyTools/GetLogs/GetLogsResponse.cs +++ b/Packages/src/Editor/FirstPartyTools/GetLogs/GetLogsResponse.cs @@ -19,13 +19,6 @@ public LogEntry(string type, string message, string stackTrace) Message = message; StackTrace = stackTrace; } - - /// - /// Parameterless constructor for JSON deserialization - /// - public LogEntry() - { - } } /// @@ -83,15 +76,5 @@ public GetLogsResponse(int totalCount, int displayedCount, string logType, int m IncludeStackTrace = includeStackTrace; Logs = logs ?? Array.Empty(); } - - /// - /// Parameterless constructor for JSON deserialization - /// - public GetLogsResponse() - { - LogType = string.Empty; - SearchText = string.Empty; - Logs = Array.Empty(); - } } } \ No newline at end of file diff --git a/Packages/src/Editor/FirstPartyTools/RunTests/RunTestsResponse.cs b/Packages/src/Editor/FirstPartyTools/RunTests/RunTestsResponse.cs index 01f02f0607..b4ec06031a 100644 --- a/Packages/src/Editor/FirstPartyTools/RunTests/RunTestsResponse.cs +++ b/Packages/src/Editor/FirstPartyTools/RunTests/RunTestsResponse.cs @@ -115,18 +115,6 @@ public RunTestsResponse( NoTestsFoundExplanation = noTestsFoundExplanation; } - /// - /// Parameterless constructor for JSON deserialization - /// - public RunTestsResponse() - { - Message = string.Empty; - Status = string.Empty; - NoTestsFoundExplanation = string.Empty; - CompletedAt = string.Empty; - XmlPath = string.Empty; - } - public static RunTestsResponse CreateTestFrameworkUnavailable() { return new RunTestsResponse( diff --git a/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/TestRunnerApiCancelBridge.cs b/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/TestRunnerApiCancelBridge.cs index 71901a1865..c04e63dfeb 100644 --- a/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/TestRunnerApiCancelBridge.cs +++ b/Packages/src/Editor/FirstPartyTools/RunTests/TestFramework/TestRunnerApiCancelBridge.cs @@ -17,21 +17,6 @@ internal static class TestRunnerApiCancelBridge private static volatile bool _resolved; private static MethodInfo _cancelTestRunMethod; private static MethodInfo _isRunActiveMethod; - private static string _resolveLog; - - /// - /// Resets cached lookup state for unit tests. - /// - internal static void ResetResolvedStateForTests() - { - lock (ResolveLock) - { - _resolved = false; - _cancelTestRunMethod = null; - _isRunActiveMethod = null; - _resolveLog = null; - } - } /// /// True when CancelTestRun(string) was resolved. @@ -57,15 +42,6 @@ internal static bool HasIsRunActive } } - internal static string ResolveLogForTests - { - get - { - EnsureResolved(); - return _resolveLog; - } - } - /// /// Invokes CancelTestRun(guid) when available. Returns false when unavailable or invoke fails. /// @@ -117,7 +93,6 @@ internal static void EnsureResolved() TestRunnerApiCancelMethodLookup.Resolve(typeof(TestRunnerApi)); _cancelTestRunMethod = cancel; _isRunActiveMethod = isRunActive; - _resolveLog = log; _resolved = true; if (!string.IsNullOrEmpty(log)) diff --git a/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/Application/KeyboardKeyState.cs b/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/Application/KeyboardKeyState.cs index 976e77b40b..db185d6715 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/Application/KeyboardKeyState.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateKeyboard/Application/KeyboardKeyState.cs @@ -74,12 +74,6 @@ public void UnregisterTransientKey(Key key) _transientKeys.Remove(key); } - public void Clear() - { - _heldKeys.Clear(); - _transientKeys.Clear(); - } - // Keyboard keys are stored as a bitfield, so StateEvent.From captures // the entire keyboard state. To support simultaneous key holds, we write // ALL currently held keys into every event — not just the target key. @@ -180,11 +174,6 @@ public static void UnregisterTransientKey(Key key) ServiceValue.UnregisterTransientKey(key); } - public static void Clear() - { - ServiceValue.Clear(); - } - public static IReadOnlyList ClearTrackedKeys() { return ServiceValue.ClearTrackedKeys(); diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Application/MouseInputState.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Application/MouseInputState.cs index a51dd88984..2787ef51d9 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Application/MouseInputState.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseInput/Application/MouseInputState.cs @@ -25,8 +25,6 @@ internal sealed class MouseInputStateService private Action? _pendingDeltaReset; private Action? _pendingScrollReset; - public bool IsButtonHeld(RuntimeMouseButton button) => _heldButtons.Contains(button); - public void RegisterPlayModeCallbacks() { EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; @@ -237,8 +235,6 @@ internal static void InitializeForEditorStartup() ServiceValue.RegisterPlayModeCallbacks(); } - public static bool IsButtonHeld(RuntimeMouseButton button) => ServiceValue.IsButtonHeld(button); - public static void SetButtonDown(RuntimeMouseButton button) { ServiceValue.SetButtonDown(button); @@ -278,11 +274,6 @@ public static void ReleaseAllButtons() { ServiceValue.ReleaseAllButtons(); } - - internal static ButtonControl GetButtonControl(Mouse mouse, RuntimeMouseButton button) - { - return ServiceValue.GetButtonControl(mouse, button); - } } } #endif diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiIncrementalDragExecutor.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiIncrementalDragExecutor.cs index c30eedcf7f..02832f459a 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiIncrementalDragExecutor.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiIncrementalDragExecutor.cs @@ -50,7 +50,7 @@ internal static async Task ExecuteDragStart( if (target == null) { SimulateMouseUiOverlayState.Update( - MouseAction.DragStart, inputPos, null, null, Handles.GetMainGameViewSize()); + MouseAction.DragStart, inputPos, null, Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome noTargetExpandOutcome = await MouseUiOverlayAnimator.PlayExpandAnimation(ct).ConfigureAwait(false); if (noTargetExpandOutcome == MouseUiFrameWaitOutcome.TimedOut) { @@ -102,7 +102,7 @@ internal static async Task ExecuteDragStart( string targetName = target.name; SimulateMouseUiOverlayState.Update( - MouseAction.DragStart, inputPos, inputPos, targetName, Handles.GetMainGameViewSize()); + MouseAction.DragStart, inputPos, inputPos, Handles.GetMainGameViewSize()); bool animationCompleted = false; try @@ -183,7 +183,7 @@ internal static async Task ExecuteDragMove( MouseAction.DragMove, MouseUiCoordinateConverter.ScreenToInput(pointerData.position), SimulateMouseUiOverlayState.DragStartPosition, - targetName, Handles.GetMainGameViewSize()); + Handles.GetMainGameViewSize()); // Cancellation leaves drag state intact so the user can continue with DragMove/DragEnd MouseUiFrameWaitOutcome dragOutcome = await MouseUiDragEventExecutor.InterpolateDragPosition( @@ -261,7 +261,7 @@ internal static async Task ExecuteDragEnd( MouseAction.DragEnd, MouseUiCoordinateConverter.ScreenToInput(pointerData.position), SimulateMouseUiOverlayState.DragStartPosition, - targetName, Handles.GetMainGameViewSize()); + Handles.GetMainGameViewSize()); // Any Paused exit inside this try still runs FinalizeDrag + MouseDragState.Clear() // in the finally below, so every in-try branch reports the drag as finalized early. @@ -310,7 +310,7 @@ internal static async Task ExecuteDragEnd( } SimulateMouseUiOverlayState.Update( - MouseAction.DragEnd, inputEnd, null, targetName, Handles.GetMainGameViewSize()); + MouseAction.DragEnd, inputEnd, null, Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome dissipateOutcome = await MouseUiOverlayAnimator.PlayDissipateAnimation(ct).ConfigureAwait(false); if (dissipateOutcome == MouseUiFrameWaitOutcome.TimedOut) diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiOneShotDragExecutor.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiOneShotDragExecutor.cs index 35e0891c1c..73752a2929 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiOneShotDragExecutor.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiOneShotDragExecutor.cs @@ -50,7 +50,7 @@ internal static async Task ExecuteDragOneShot( if (target == null) { SimulateMouseUiOverlayState.Update( - MouseAction.Drag, inputStart, null, null, Handles.GetMainGameViewSize()); + MouseAction.Drag, inputStart, null, Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome noTargetExpandOutcome = await MouseUiOverlayAnimator.PlayExpandAnimation(ct).ConfigureAwait(false); if (noTargetExpandOutcome == MouseUiFrameWaitOutcome.TimedOut) { @@ -102,7 +102,7 @@ internal static async Task ExecuteDragOneShot( string targetName = target.name; SimulateMouseUiOverlayState.Update( - MouseAction.Drag, inputStart, inputStart, targetName, Handles.GetMainGameViewSize()); + MouseAction.Drag, inputStart, inputStart, Handles.GetMainGameViewSize()); // Any Paused exit inside this try still runs FinalizeDrag in the finally below // (pointerUp/drop/endDrag), so every branch reports the drag as finalized early @@ -161,7 +161,7 @@ internal static async Task ExecuteDragOneShot( } SimulateMouseUiOverlayState.Update( - MouseAction.Drag, inputEnd, inputStart, targetName, Handles.GetMainGameViewSize()); + MouseAction.Drag, inputEnd, inputStart, Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome dissipateOutcome = await MouseUiOverlayAnimator.PlayDissipateAnimation(ct).ConfigureAwait(false); if (dissipateOutcome == MouseUiFrameWaitOutcome.TimedOut) diff --git a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs index 1eabaffeee..66795b2aa4 100644 --- a/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs +++ b/Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs @@ -48,7 +48,7 @@ internal static async Task ExecuteClick( bool hitTarget = resolvedTargets.Target != null; SimulateMouseUiOverlayState.Update( MouseAction.Click, inputPos, null, - targetName, Handles.GetMainGameViewSize()); + Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome expandOutcome = await MouseUiOverlayAnimator.PlayExpandAnimation(ct).ConfigureAwait(false); if (expandOutcome == MouseUiFrameWaitOutcome.TimedOut) @@ -130,7 +130,7 @@ internal static async Task ExecuteLongPress( bool shouldReleasePointer = resolvedTargets.RawTarget != null && resolvedTargets.Target != null; SimulateMouseUiOverlayState.Update( MouseAction.LongPress, inputPos, null, - targetName, Handles.GetMainGameViewSize()); + Handles.GetMainGameViewSize()); MouseUiFrameWaitOutcome expandOutcome = await MouseUiOverlayAnimator.PlayExpandAnimation(ct).ConfigureAwait(false); if (expandOutcome == MouseUiFrameWaitOutcome.TimedOut) diff --git a/Packages/src/Editor/FirstPartyTools/Watch/WatchExpressionStepMonitor.cs b/Packages/src/Editor/FirstPartyTools/Watch/WatchExpressionStepMonitor.cs index 8789a85eed..18c3eb4eb1 100644 --- a/Packages/src/Editor/FirstPartyTools/Watch/WatchExpressionStepMonitor.cs +++ b/Packages/src/Editor/FirstPartyTools/Watch/WatchExpressionStepMonitor.cs @@ -26,17 +26,6 @@ public void Start() _isStarted = true; } - public void Stop() - { - if (!_isStarted) - { - return; - } - - EditorApplication.update -= OnEditorUpdate; - _isStarted = false; - } - private void OnEditorUpdate() { _registry.EvaluateIfFrameChanged(); diff --git a/Packages/src/Editor/Infrastructure/CLI/CliInstallationDetector.cs b/Packages/src/Editor/Infrastructure/CLI/CliInstallationDetector.cs index 6168cc7965..c0ab2c177a 100644 --- a/Packages/src/Editor/Infrastructure/CLI/CliInstallationDetector.cs +++ b/Packages/src/Editor/Infrastructure/CLI/CliInstallationDetector.cs @@ -140,11 +140,6 @@ private static Task DetectCliInstallationAsync(Cancell return Task.Run(() => DetectCliInstallationBlocking(platform, ct), ct); } - internal static string DetectCliVersionBlocking(RuntimePlatform platform, CancellationToken ct) - { - return DetectCliInstallationBlocking(platform, ct).Version; - } - internal static CliInstallationDetection DetectCliInstallationBlocking(RuntimePlatform platform, CancellationToken ct) { CliInstallationDetection packageOwnedDetection = DetectPackageOwnedCliInstallationBlocking(platform, ct); diff --git a/Packages/src/Editor/Infrastructure/Server/UnityCliLoopServerController.cs b/Packages/src/Editor/Infrastructure/Server/UnityCliLoopServerController.cs index 0c42a97820..e4fe040528 100644 --- a/Packages/src/Editor/Infrastructure/Server/UnityCliLoopServerController.cs +++ b/Packages/src/Editor/Infrastructure/Server/UnityCliLoopServerController.cs @@ -395,16 +395,6 @@ public void RemoveServerStateChangedHandler(Action handler) { _serverLifecycleRegistry.ServerStateChanged -= handler; } - - public void AddServerStartedHandler(Action handler) - { - _serverLifecycleRegistry.ServerStarted += handler; - } - - public void RemoveServerStartedHandler(Action handler) - { - _serverLifecycleRegistry.ServerStarted -= handler; - } } } diff --git a/Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRepository.cs b/Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRepository.cs index c958200a28..330bb33503 100644 --- a/Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRepository.cs +++ b/Packages/src/Editor/Infrastructure/Settings/UnityCliLoopEditorSettingsRepository.cs @@ -121,14 +121,6 @@ public string GetLastSeenSetupWizardVersion() return GetSettings().lastSeenSetupWizardVersion ?? string.Empty; } - public void SetLastSeenSetupWizardVersion(string version) - { - string normalizedVersion = version ?? string.Empty; - UnityCliLoopEditorSettingsData settings = GetSettings(); - UnityCliLoopEditorSettingsData updatedSettings = settings with { lastSeenSetupWizardVersion = normalizedVersion }; - SaveSettings(updatedSettings); - } - public bool GetSuppressSetupWizardAutoShow() { return GetSettings().suppressSetupWizardAutoShow; @@ -141,13 +133,6 @@ public void SetSuppressSetupWizardAutoShow(bool suppressAutoShow) SaveSettings(updatedSettings); } - public void SetShowUnityCliLoopSecuritySetting(bool showUnityCliLoopSecuritySetting) - { - UnityCliLoopEditorSettingsData settings = GetSettings(); - UnityCliLoopEditorSettingsData newSettings = settings with { showUnityCliLoopSecuritySetting = showUnityCliLoopSecuritySetting }; - SaveSettings(newSettings); - } - public void SetShowToolSettings(bool showToolSettings) { UnityCliLoopEditorSettingsData settings = GetSettings(); diff --git a/Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallationDetector.cs b/Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallationDetector.cs index 3a4de7cade..5e2baa2c64 100644 --- a/Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallationDetector.cs +++ b/Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallationDetector.cs @@ -11,22 +11,6 @@ namespace io.github.hatayama.UnityCliLoop.Infrastructure /// public sealed class SkillInstallationDetector { - public bool AreSkillsInstalled(string targetDir) - { - Debug.Assert(!string.IsNullOrEmpty(targetDir), "targetDir must not be null or empty"); - - string projectRoot = UnityCliLoopPathResolver.GetProjectRoot(); - return AreSkillsInstalledInAnyLayout(projectRoot, targetDir); - } - - public bool AreSkillsInstalled(string targetDir, bool groupSkillsUnderUnityCliLoop) - { - Debug.Assert(!string.IsNullOrEmpty(targetDir), "targetDir must not be null or empty"); - - string projectRoot = UnityCliLoopPathResolver.GetProjectRoot(); - return AreSkillsInstalledForLayout(projectRoot, targetDir, groupSkillsUnderUnityCliLoop); - } - internal bool AreSkillsInstalledInAnyLayout(string projectRoot, string targetDir) { Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty"); diff --git a/Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSynchronizer.cs b/Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSynchronizer.cs index ab71d38e14..4a2cd94c93 100644 --- a/Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSynchronizer.cs +++ b/Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSynchronizer.cs @@ -79,22 +79,6 @@ public static bool IsSkillInstalled(string toolName) return false; } - public static List DetectTargetsForLayout(bool groupSkillsUnderUnityCliLoop) - { - string projectRoot = UnityCliLoopPathResolver.GetProjectRoot(); - Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty"); - - return DetectTargetsForLayoutAtProjectRoot(projectRoot, groupSkillsUnderUnityCliLoop); - } - - public static List DetectTargetsForLayoutFast(bool groupSkillsUnderUnityCliLoop) - { - string projectRoot = UnityCliLoopPathResolver.GetProjectRoot(); - Debug.Assert(!string.IsNullOrEmpty(projectRoot), "projectRoot must not be null or empty"); - - return DetectTargetsForLayoutFastAtProjectRoot(projectRoot, groupSkillsUnderUnityCliLoop); - } - internal static List DetectTargetsForLayoutAtProjectRoot( string projectRoot, bool groupSkillsUnderUnityCliLoop) diff --git a/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs b/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs index c9861f90cd..313c832abb 100644 --- a/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs +++ b/Packages/src/Editor/Infrastructure/ThirdPartyToolMigration/ThirdPartyToolMigrationRules.cs @@ -138,19 +138,6 @@ internal static bool ContainsCurrentToolContractsApi(string source) return ThirdPartyToolMigrationApiDetectionRules.ContainsCurrentToolContractsApi(source); } - internal static bool ContainsLegacyDomainMetadataApi(string source) - { - return ThirdPartyToolMigrationApiDetectionRules.ContainsLegacyDomainMetadataApi(source); - } - - internal static bool ContainsLegacyDomainHelperApiForAssembly( - string source, - bool hasLegacyAssemblySource, - string[] legacyAssemblyAliases) - { - return ThirdPartyToolMigrationApiDetectionRules.ContainsLegacyDomainHelperApiForAssembly(source, hasLegacyAssemblySource, legacyAssemblyAliases); - } - internal static bool ContainsCurrentDomainMetadataApi(string source) { return ThirdPartyToolMigrationApiDetectionRules.ContainsCurrentDomainMetadataApi(source); @@ -205,11 +192,6 @@ internal static bool ContainsLegacyEditorWindowCaptureUtilityTimeoutMigrationFor return ThirdPartyToolMigrationApiDetectionRules.ContainsLegacyEditorWindowCaptureUtilityTimeoutMigrationForAssembly(source, hasLegacyAssemblySource, hasAssemblyScopedCurrentToolContractsUsing, hasAssemblyScopedCurrentFirstPartyToolsUsing, legacyAssemblyAliases, currentFirstPartyToolsAssemblyAliases, assemblyDeclaredTypeNames); } - internal static bool ContainsCurrentFirstPartyScreenshotApi(string source) - { - return ThirdPartyToolMigrationApiDetectionRules.ContainsCurrentFirstPartyScreenshotApi(source); - } - internal static bool ContainsCurrentFirstPartyScreenshotApiForAssembly( string source, bool hasAssemblyScopedCurrentFirstPartyToolsUsing, diff --git a/Packages/src/Editor/Infrastructure/Utils/NodeEnvironmentResolver.cs b/Packages/src/Editor/Infrastructure/Utils/NodeEnvironmentResolver.cs index 5fc1ab4d3c..4fb85acdb2 100644 --- a/Packages/src/Editor/Infrastructure/Utils/NodeEnvironmentResolver.cs +++ b/Packages/src/Editor/Infrastructure/Utils/NodeEnvironmentResolver.cs @@ -13,16 +13,6 @@ public static class NodeEnvironmentResolver { private const int PROCESS_TIMEOUT_MS = 5000; - /// - /// Finds an executable path using platform-appropriate resolution. - /// On Windows, resolves .cmd shims via 'where' command. - /// On Unix, resolves via login shell 'which' command. - /// - public static string FindExecutablePath(string executableName) - { - return FindExecutablePathAtPlatform(executableName, UnityEngine.Application.platform); - } - internal static string FindExecutablePathAtPlatform(string executableName, RuntimePlatform platform) { if (IsWindowsEditor(platform)) @@ -177,8 +167,6 @@ private static string ExecuteAndGetOutput(ProcessStartInfo startInfo) return null; } - private const string PATH_START_MARKER = "__PATH_START__"; - private const string PATH_END_MARKER = "__PATH_END__"; private const string WHICH_START_MARKER = "__WHICH_START__"; private const string WHICH_END_MARKER = "__WHICH_END__"; private const string POSIX_FALLBACK_SHELL_PATH = "/bin/sh"; @@ -187,28 +175,6 @@ private static string ExecuteAndGetOutput(ProcessStartInfo startInfo) private const string DIRECTORY_SERVICE_USER_SHELL_ATTRIBUTE = "UserShell"; private const string DIRECTORY_SERVICE_USER_SHELL_PREFIX = DIRECTORY_SERVICE_USER_SHELL_ATTRIBUTE + ":"; - // Uses markers to extract PATH value, ignoring any banner/echo output from shell startup files - internal static string GetLoginShellPathAtPlatform(RuntimePlatform platform) - { - if (IsWindowsEditor(platform)) - { - return null; - } - - string shell = GetUserShell(); - ProcessStartInfo startInfo = new() { - FileName = shell, - Arguments = "-l -i -c \"echo " + PATH_START_MARKER + "; printenv PATH; echo " + PATH_END_MARKER + "\"", - UseShellExecute = false, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true - }; - - string output = ExecuteAndGetOutput(startInfo); - return ExtractBetweenMarkers(output, PATH_START_MARKER, PATH_END_MARKER); - } - internal static string ExtractBetweenMarkers(string output, string startMarker, string endMarker) { if (string.IsNullOrEmpty(output)) diff --git a/Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs b/Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs index 2eae55a809..0d18207e9b 100644 --- a/Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs +++ b/Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs @@ -176,11 +176,6 @@ internal static bool ShouldRemoveMigrationSkill(SkillInstallState installState) || installState == SkillInstallState.Outdated; } - internal static bool HasFiniteSize(Vector2 size) - { - return ThirdPartyToolMigrationWizardWindowResizer.HasFiniteSize(size); - } - internal static bool ShouldReportMigrationProgress( long lastReportTimestamp, long currentTimestamp, diff --git a/Packages/src/Editor/Presentation/Shared/SkillsSetupPanelView.cs b/Packages/src/Editor/Presentation/Shared/SkillsSetupPanelView.cs index 068c1acdc0..7733d78ca9 100644 --- a/Packages/src/Editor/Presentation/Shared/SkillsSetupPanelView.cs +++ b/Packages/src/Editor/Presentation/Shared/SkillsSetupPanelView.cs @@ -21,7 +21,6 @@ internal sealed class SkillsSetupPanelView private readonly Foldout _installSpecificTargetFoldout; private readonly VisualElement _groupSkillsRow; private readonly Toggle _groupSkillsToggle; - private readonly Label _groupSkillsLabel; private readonly EnumField _skillsTargetField; private readonly Button _refreshSkillsStateButton; private readonly Button _installSelectedSkillsButton; @@ -35,10 +34,6 @@ internal sealed class SkillsSetupPanelView internal event System.Action OnTargetChanged; internal event System.Action OnGroupSkillsChanged; - internal Toggle GroupSkillsToggle => _groupSkillsToggle; - internal Label GroupSkillsLabel => _groupSkillsLabel; - internal VisualElement GroupSkillsRow => _groupSkillsRow; - internal SkillsSetupPanelView(VisualElement panelRoot, Button refreshSkillsStateButton) { Debug.Assert(panelRoot != null, "panelRoot must not be null"); @@ -55,7 +50,6 @@ internal SkillsSetupPanelView(VisualElement panelRoot, Button refreshSkillsState _installSpecificTargetFoldout = root.Q("install-specific-target-foldout"); _groupSkillsRow = root.Q("group-skills-row"); _groupSkillsToggle = root.Q("group-skills-toggle"); - _groupSkillsLabel = root.Q public static class ViewDataBinder { - public static void BindToggle(Toggle toggle, Func getter, Action onChanged) - { - toggle.SetValueWithoutNotify(getter()); - toggle.RegisterValueChangedCallback(evt => onChanged(evt.newValue)); - } - - public static void BindIntegerField(IntegerField field, Func getter, Action onChanged) - { - field.SetValueWithoutNotify(getter()); - field.RegisterValueChangedCallback(evt => onChanged(evt.newValue)); - } - - public static void BindEnumField(EnumField field, Func getter, Action onChanged) where T : Enum - { - field.Init(getter()); - field.RegisterValueChangedCallback(evt => - { - if (evt.newValue is T newValue) - { - onChanged(newValue); - } - }); - } - - public static void BindFoldout(Foldout foldout, Func getter, Action onChanged) - { - foldout.SetValueWithoutNotify(getter()); - foldout.RegisterValueChangedCallback(evt => onChanged(evt.newValue)); - } - - public static void BindButton(Button button, Action onClick) - { - button.clicked += onClick; - } - - public static void BindLabel(Label label, Action