diff --git a/MCPForUnity/Editor/Tools/ManageScript.cs b/MCPForUnity/Editor/Tools/ManageScript.cs index 51669c65..b5cbbb1d 100644 --- a/MCPForUnity/Editor/Tools/ManageScript.cs +++ b/MCPForUnity/Editor/Tools/ManageScript.cs @@ -1933,15 +1933,8 @@ string namespaceName /// private static ValidationLevel GetValidationLevelFromGUI() { - string savedLevel = EditorPrefs.GetString("MCPForUnity_ScriptValidationLevel", "standard"); - return savedLevel.ToLower() switch - { - "basic" => ValidationLevel.Basic, - "standard" => ValidationLevel.Standard, - "comprehensive" => ValidationLevel.Comprehensive, - "strict" => ValidationLevel.Strict, - _ => ValidationLevel.Standard // Default fallback - }; + int savedLevel = EditorPrefs.GetInt("MCPForUnity.ValidationLevel", (int)ValidationLevel.Standard); + return (ValidationLevel)Mathf.Clamp(savedLevel, 0, 3); } /// diff --git a/deploy-dev.bat b/deploy-dev.bat index 60a398bd..300856d3 100644 --- a/deploy-dev.bat +++ b/deploy-dev.bat @@ -11,7 +11,7 @@ set "SCRIPT_DIR=%~dp0" set "BRIDGE_SOURCE=%SCRIPT_DIR%MCPForUnity" set "SERVER_SOURCE=%SCRIPT_DIR%MCPForUnity\UnityMcpServer~\src" set "DEFAULT_BACKUP_DIR=%USERPROFILE%\Desktop\unity-mcp-backup" -set "DEFAULT_SERVER_PATH=%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src" +set "DEFAULT_SERVER_PATH=%LOCALAPPDATA%\UnityMCP\UnityMcpServer\src" :: Get user inputs echo Please provide the following paths: @@ -19,7 +19,7 @@ echo. :: Package cache location echo Unity Package Cache Location: -echo Example: X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@1.0.0 +echo Example: X:\Unity\Projects\UnityMCPTestbed2\Library\PackageCache\com.coplaydev.unity-mcp@4c106125b342 set /p "PACKAGE_CACHE_PATH=Enter Unity package cache path: " if "%PACKAGE_CACHE_PATH%"=="" ( diff --git a/restore-dev.bat b/restore-dev.bat index 6f68be0b..81311f6c 100644 --- a/restore-dev.bat +++ b/restore-dev.bat @@ -11,7 +11,7 @@ echo. :: Configuration set "DEFAULT_BACKUP_DIR=%USERPROFILE%\Desktop\unity-mcp-backup" -set "DEFAULT_SERVER_PATH=%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src" +set "DEFAULT_SERVER_PATH=%LOCALAPPDATA%\UnityMCP\UnityMcpServer\src" :: Get user inputs echo Please provide the following paths: @@ -102,7 +102,8 @@ echo =============================================== echo WARNING: This will overwrite current files! echo =============================================== echo Restoring from: %SELECTED_BACKUP% -echo Unity Bridge target: %PACKAGE_CACHE_PATH%\Editor +echo Unity Bridge Editor target: %PACKAGE_CACHE_PATH%\Editor +echo Unity Bridge Runtime target: %PACKAGE_CACHE_PATH%\Runtime echo Python Server target: %SERVER_PATH% echo. set /p "confirm=Continue with restore? (y/N): " @@ -119,16 +120,29 @@ echo =============================================== :: Restore Unity Bridge if exist "%SELECTED_BACKUP%\UnityBridge\Editor" ( - echo Restoring Unity Bridge files... + echo Restoring Unity Bridge Editor files... rd /s /q "%PACKAGE_CACHE_PATH%\Editor" 2>nul xcopy "%SELECTED_BACKUP%\UnityBridge\Editor\*" "%PACKAGE_CACHE_PATH%\Editor\" /E /I /Y > nul if !errorlevel! neq 0 ( - echo Error: Failed to restore Unity Bridge files + echo Error: Failed to restore Unity Bridge Editor files pause exit /b 1 ) ) else ( - echo Warning: No Unity Bridge backup found, skipping... + echo Warning: No Unity Bridge Editor backup found, skipping... +) + +if exist "%SELECTED_BACKUP%\UnityBridge\Runtime" ( + echo Restoring Unity Bridge Runtime files... + rd /s /q "%PACKAGE_CACHE_PATH%\Runtime" 2>nul + xcopy "%SELECTED_BACKUP%\UnityBridge\Runtime\*" "%PACKAGE_CACHE_PATH%\Runtime\" /E /I /Y > nul + if !errorlevel! neq 0 ( + echo Error: Failed to restore Unity Bridge Runtime files + pause + exit /b 1 + ) +) else ( + echo Warning: No Unity Bridge Runtime backup found, skipping... ) :: Restore Python Server