unity-mcp/TestProjects/UnityMCPTests/Assets
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
..
Scenes Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Scripts fix: replace Editor-only McpLog with Debug.LogWarning in Runtime assembly (#535) 2026-01-08 07:59:05 -08:00
Tests fix: Add special handling for UIDocument serialization to prevent infinite loops (#586) 2026-01-19 08:21:36 -08:00
Packages.meta feature/Add new manage_scriptable_object tool (#489) 2025-12-28 20:15:50 -08:00
Scenes.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Scripts.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Temp.meta 🔧 Clean up & Consolidate Shared Services Across MCP Tools (#519) 2026-01-06 12:58:17 -08:00
Tests.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00