unity-mcp/MCPForUnity/Editor/Helpers
dsarno aaf6308b33
fix: Add special handling for UIDocument serialization to prevent infinite loops (#586)
* fix: search inactive objects when setActive=true in modify

When trying to activate an inactive GameObject via manage_gameobject modify with setActive=true, the lookup would fail because inactive objects were not included in the search by default.

Now automatically sets searchInactive=true when setActive=true is specified, allowing inactive objects to be found and activated.

* fix: Add special handling for UIDocument serialization to prevent infinite loops (#585)

UIDocument.rootVisualElement contains circular parent/child references that
can cause infinite serialization loops. This adds special handling similar to
Transform and Camera components.

The fix:
- Safely serializes panelSettings, visualTreeAsset, sortingOrder, enabled, parentUI
- Explicitly skips rootVisualElement to prevent circular reference issues
- Includes a note explaining why rootVisualElement is skipped

Tested on Unity 2021.3 and Unity 6.3.

* refactor: Extract SerializeAssetReference helper and align UIDocument structure

- Add SerializeAssetReference() helper for consistent asset reference serialization
- UIDocument now uses same return structure as Camera (typeName, instanceID, properties)
- Reduces code duplication in special-case handlers
- Enhanced test coverage to verify structure matches Camera pattern

* fix: Handle UIDocument subclasses and add negative assertion for rootVisualElement

Address code review feedback:
- Add IsOrDerivedFrom() helper to detect UIDocument and any subclasses by walking
  the base-type chain, ensuring derived types also get special-case handling
- Add negative assertion verifying rootVisualElement is NOT in serialized output
2026-01-19 08:21:36 -08:00
..
AssetPathUtility.cs Fixes Windows installation failures caused by long path issues when cloning the full repository via git URL (MAX_PATH 260 char limit exceeded by files in TestProjects/). (#534) 2026-01-08 07:14:44 -08:00
AssetPathUtility.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
CodexConfigHelper.cs Fix HTTP/Stdio Transport UX and Test Bug (#530) 2026-01-07 23:33:22 -04:00
CodexConfigHelper.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ComponentOps.cs Fix manage_components set_property for object references (#551) 2026-01-13 22:23:18 -08:00
ComponentOps.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ConfigJsonBuilder.cs fix: resolve Claude Code HTTP Remote UV path override not being detected in System Requirements .#550 2026-01-17 18:34:40 -05:00
ConfigJsonBuilder.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ExecPath.cs fix: resolve Claude Code HTTP Remote UV path override not being detected in System Requirements .#550 2026-01-17 18:34:40 -05:00
ExecPath.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
GameObjectLookup.cs fix: Add Prefab Stage support for GameObject lookup (#573) 2026-01-19 06:46:29 -08:00
GameObjectLookup.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
GameObjectSerializer.cs fix: Add special handling for UIDocument serialization to prevent infinite loops (#586) 2026-01-19 08:21:36 -08:00
GameObjectSerializer.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
HttpEndpointUtility.cs Remove distribution settings scriptable object (#473) 2025-12-19 19:11:54 -04:00
HttpEndpointUtility.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
MaterialOps.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
MaterialOps.cs.meta feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
McpConfigurationHelper.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
McpConfigurationHelper.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
McpJobStateStore.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpJobStateStore.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpLog.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
McpLog.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
ObjectResolver.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
ObjectResolver.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
Pagination.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
Pagination.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
ParamCoercion.cs v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00
ParamCoercion.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00
PortManager.cs Fix: Python Detection, Port Conflicts, and Script Creation Reliability (#428) 2025-12-04 13:19:42 -08:00
PortManager.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
ProjectIdentityUtility.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
ProjectIdentityUtility.cs.meta HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
PropertyConversion.cs Asset store helper script + updated README (#521) 2026-01-07 01:33:20 -04:00
PropertyConversion.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
RenderPipelineUtility.cs Add support for 'standard' shader alias 2026-01-10 23:17:44 -05:00
RenderPipelineUtility.cs.meta [FIX] Temp Update on Material Assignment (#420) 2025-12-03 00:39:38 -05:00
RendererHelpers.cs [FEATURE]: Manage VFX function (#520) 2026-01-07 01:47:32 -05:00
RendererHelpers.cs.meta [FEATURE]: Manage VFX function (#520) 2026-01-07 01:47:32 -05:00
Response.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
Response.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
TelemetryHelper.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
TelemetryHelper.cs.meta Add .meta files (#472) 2025-12-19 18:59:19 -04:00
UnityJsonSerializer.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityJsonSerializer.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityTypeResolver.cs 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
UnityTypeResolver.cs.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
VectorParsing.cs v9 pre-release pruning (#528) 2026-01-07 18:51:51 -04:00
VectorParsing.cs.meta 🎮 GameObject Toolset Redesign and Streamlining (#518) 2026-01-06 10:13:45 -08:00