unity-mcp/Server/src
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
..
cli Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
core Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
models HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
services Add create_child parameter to manage_prefabs modify_contents (#646) 2026-01-29 04:14:52 -08:00
transport Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
utils Large Cleanup and Refactor + Many new Tests added (#642) 2026-01-29 02:47:36 -08:00
__init__.py HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
main.py feat: Add beta server mode with PyPI pre-release support (#640) 2026-01-27 11:34:11 -08:00