unity-mcp/TestProjects/UnityMCPTests/Assets/Tests/EditMode
dsarno 62c015d873
Add create_child parameter to manage_prefabs modify_contents (#646)
* Add create_child parameter to manage_prefabs modify_contents

Enables adding child GameObjects to existing prefabs via headless editing.
Supports single object or array for batch creation in one save operation.

Features:
- Create children with primitive types (Cube, Sphere, etc.)
- Set position, rotation, scale on new children
- Add components to children
- Specify parent within prefab hierarchy for nested children
- Set tag, layer, and active state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Address code review feedback for create_child validation

- Fix type hint to `tuple[dict | None, str | None]` to match actual returns
- Add explicit dict validation with clear error message including actual type
- Error on invalid component entries instead of silently ignoring them
- Return ErrorResponse for invalid tag/layer instead of just logging warnings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add unit tests for create_child prefab functionality

Tests cover:
- Single child with primitive type
- Empty GameObject (no primitive_type)
- Multiple children from array (batch creation)
- Nested parenting within prefab
- Error handling for invalid inputs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 04:14:52 -08:00
..
Helpers Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
Resources Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services Fix/uvx logassert (#645) 2026-01-29 03:15:02 -08:00
Tools Add create_child parameter to manage_prefabs modify_contents (#646) 2026-01-29 04:14:52 -08:00
Windows Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
Helpers.meta Add Codex to autoconfig options (#288) 2025-09-26 18:05:30 -04:00
MCPForUnityTests.Editor.asmdef Test/478 matrix4x4 serialization crash (#481) 2025-12-23 15:53:14 -08:00
MCPForUnityTests.Editor.asmdef.meta Rename namespace and public facing plugin output from "Unity MCP" to "MCP for Unity" (#225) 2025-08-20 15:59:49 -04:00
Resources.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services.meta Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
TestUtilities.cs Harden `manage_scriptable_object` Tool (#522) 2026-01-07 10:46:35 -04:00
TestUtilities.cs.meta Harden `manage_scriptable_object` Tool (#522) 2026-01-07 10:46:35 -04:00
Tools.meta Improve Windsurf MCP Config (#231) 2025-08-24 06:57:11 -04:00
Windows.meta Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00