From 2df3ea3f7f70fe941565c107c2759c47ea8d5386 Mon Sep 17 00:00:00 2001 From: Valentina Date: Thu, 8 Oct 2026 23:03:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=BD=D0=B5=D0=B4=D1=80=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=B9=D1=80=D0=BE=D0=BD=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agent/skills/animation-create/SKILL.md | 139 +++++ .agent/skills/animation-get-data/SKILL.md | 254 ++++++++ .agent/skills/animation-modify/SKILL.md | 310 ++++++++++ .agent/skills/animator-create/SKILL.md | 139 +++++ .agent/skills/animator-get-data/SKILL.md | 347 +++++++++++ .agent/skills/animator-modify/SKILL.md | 296 ++++++++++ .agent/skills/assets-copy/SKILL.md | 160 ++++++ .agent/skills/assets-create-folder/SKILL.md | 129 +++++ .agent/skills/assets-delete/SKILL.md | 114 ++++ .agent/skills/assets-find-built-in/SKILL.md | 140 +++++ .agent/skills/assets-find/SKILL.md | 144 +++++ .agent/skills/assets-get-data/SKILL.md | 200 +++++++ .agent/skills/assets-material-create/SKILL.md | 127 ++++ .agent/skills/assets-modify/SKILL.md | 215 +++++++ .agent/skills/assets-move/SKILL.md | 121 ++++ .agent/skills/assets-prefab-close/SKILL.md | 117 ++++ .agent/skills/assets-prefab-create/SKILL.md | 180 ++++++ .../skills/assets-prefab-instantiate/SKILL.md | 175 ++++++ .agent/skills/assets-prefab-open/SKILL.md | 113 ++++ .agent/skills/assets-prefab-save/SKILL.md | 113 ++++ .agent/skills/assets-refresh/SKILL.md | 82 +++ .agent/skills/assets-shader-get-data/SKILL.md | 461 +++++++++++++++ .agent/skills/assets-shader-list-all/SKILL.md | 86 +++ .../skills/cinemachine-add-extension/SKILL.md | 226 ++++++++ .../skills/cinemachine-brain-ensure/SKILL.md | 221 +++++++ .../skills/cinemachine-camera-create/SKILL.md | 275 +++++++++ .agent/skills/cinemachine-camera-get/SKILL.md | 285 +++++++++ .../skills/cinemachine-camera-list/SKILL.md | 197 +++++++ .agent/skills/cinemachine-get/SKILL.md | 295 ++++++++++ .agent/skills/cinemachine-modify/SKILL.md | 307 ++++++++++ .agent/skills/cinemachine-set-aim/SKILL.md | 252 ++++++++ .agent/skills/cinemachine-set-body/SKILL.md | 275 +++++++++ .../cinemachine-set-default-blend/SKILL.md | 242 ++++++++ .agent/skills/cinemachine-set-lens/SKILL.md | 268 +++++++++ .agent/skills/cinemachine-set-noise/SKILL.md | 241 ++++++++ .../skills/cinemachine-set-priority/SKILL.md | 223 +++++++ .../skills/cinemachine-set-targets/SKILL.md | 243 ++++++++ .agent/skills/console-clear-logs/SKILL.md | 64 +++ .agent/skills/console-get-logs/SKILL.md | 145 +++++ .../editor-application-get-state/SKILL.md | 127 ++++ .../editor-application-set-state/SKILL.md | 137 +++++ .agent/skills/editor-selection-get/SKILL.md | 253 ++++++++ .agent/skills/editor-selection-set/SKILL.md | 254 ++++++++ .../skills/gameobject-component-add/SKILL.md | 202 +++++++ .../gameobject-component-destroy/SKILL.md | 209 +++++++ .../skills/gameobject-component-get/SKILL.md | 346 +++++++++++ .../gameobject-component-list-all/SKILL.md | 133 +++++ .../gameobject-component-modify/SKILL.md | 331 +++++++++++ .agent/skills/gameobject-create/SKILL.md | 231 ++++++++ .agent/skills/gameobject-destroy/SKILL.md | 149 +++++ .agent/skills/gameobject-duplicate/SKILL.md | 184 ++++++ .agent/skills/gameobject-find/SKILL.md | 423 ++++++++++++++ .agent/skills/gameobject-modify/SKILL.md | 262 +++++++++ .agent/skills/gameobject-set-parent/SKILL.md | 148 +++++ .agent/skills/inputsystem-action-add/SKILL.md | 177 ++++++ .../skills/inputsystem-action-remove/SKILL.md | 130 +++++ .../skills/inputsystem-actionmap-add/SKILL.md | 119 ++++ .../inputsystem-actionmap-remove/SKILL.md | 119 ++++ .../skills/inputsystem-asset-create/SKILL.md | 113 ++++ .../skills/inputsystem-binding-add/SKILL.md | 164 ++++++ .../SKILL.md | 187 ++++++ .../inputsystem-binding-remove/SKILL.md | 141 +++++ .../skills/inputsystem-binding-set/SKILL.md | 176 ++++++ .../inputsystem-controlscheme-add/SKILL.md | 149 +++++ .agent/skills/inputsystem-get/SKILL.md | 227 ++++++++ .agent/skills/inputsystem-modify/SKILL.md | 168 ++++++ .agent/skills/inputsystem-save/SKILL.md | 113 ++++ .agent/skills/navigation-agent-add/SKILL.md | 284 +++++++++ .../navigation-agent-set-destination/SKILL.md | 288 ++++++++++ .agent/skills/navigation-get/SKILL.md | 295 ++++++++++ .agent/skills/navigation-link-add/SKILL.md | 312 ++++++++++ .agent/skills/navigation-list/SKILL.md | 246 ++++++++ .../skills/navigation-modifier-add/SKILL.md | 255 ++++++++ .../navigation-modifier-volume-add/SKILL.md | 284 +++++++++ .agent/skills/navigation-modify/SKILL.md | 307 ++++++++++ .../navigation-set-bake-settings/SKILL.md | 249 ++++++++ .agent/skills/navigation-surface-add/SKILL.md | 294 ++++++++++ .../skills/navigation-surface-bake/SKILL.md | 227 ++++++++ .agent/skills/object-get-data/SKILL.md | 188 ++++++ .agent/skills/object-modify/SKILL.md | 287 ++++++++++ .agent/skills/package-add/SKILL.md | 75 +++ .agent/skills/package-list/SKILL.md | 138 +++++ .agent/skills/package-remove/SKILL.md | 71 +++ .agent/skills/package-search/SKILL.md | 149 +++++ .agent/skills/particle-system-get/SKILL.md | 542 ++++++++++++++++++ .agent/skills/particle-system-modify/SKILL.md | 419 ++++++++++++++ .agent/skills/ping/SKILL.md | 82 +++ .agent/skills/probuilder-bevel/SKILL.md | 185 ++++++ .agent/skills/probuilder-bridge/SKILL.md | 206 +++++++ .../skills/probuilder-connect-edges/SKILL.md | 215 +++++++ .../probuilder-create-poly-shape/SKILL.md | 288 ++++++++++ .../skills/probuilder-create-shape/SKILL.md | 246 ++++++++ .../skills/probuilder-delete-faces/SKILL.md | 206 +++++++ .agent/skills/probuilder-extrude/SKILL.md | 229 ++++++++ .../skills/probuilder-flip-normals/SKILL.md | 197 +++++++ .../skills/probuilder-get-mesh-info/SKILL.md | 333 +++++++++++ .../skills/probuilder-merge-objects/SKILL.md | 241 ++++++++ .../probuilder-set-face-material/SKILL.md | 219 +++++++ .agent/skills/probuilder-set-pivot/SKILL.md | 195 +++++++ .../probuilder-subdivide-edges/SKILL.md | 221 +++++++ .agent/skills/profiler-capture-frame/SKILL.md | 122 ++++ .agent/skills/profiler-clear-data/SKILL.md | 78 +++ .agent/skills/profiler-enable-module/SKILL.md | 91 +++ .../skills/profiler-get-memory-stats/SKILL.md | 146 +++++ .../profiler-get-rendering-stats/SKILL.md | 122 ++++ .../skills/profiler-get-script-stats/SKILL.md | 130 +++++ .agent/skills/profiler-get-status/SKILL.md | 121 ++++ .agent/skills/profiler-list-modules/SKILL.md | 115 ++++ .agent/skills/profiler-load-data/SKILL.md | 89 +++ .agent/skills/profiler-save-data/SKILL.md | 89 +++ .agent/skills/profiler-start/SKILL.md | 80 +++ .agent/skills/profiler-stop/SKILL.md | 78 +++ .agent/skills/reflection-method-call/SKILL.md | 254 ++++++++ .agent/skills/reflection-method-find/SKILL.md | 151 +++++ .agent/skills/scene-create/SKILL.md | 166 ++++++ .agent/skills/scene-get-data/SKILL.md | 437 ++++++++++++++ .agent/skills/scene-list-opened/SKILL.md | 137 +++++ .agent/skills/scene-open/SKILL.md | 187 ++++++ .agent/skills/scene-save/SKILL.md | 74 +++ .agent/skills/scene-set-active/SKILL.md | 178 ++++++ .agent/skills/scene-unload/SKILL.md | 132 +++++ .agent/skills/screenshot-camera/SKILL.md | 121 ++++ .agent/skills/screenshot-game-view/SKILL.md | 64 +++ .agent/skills/screenshot-isolated/SKILL.md | 207 +++++++ .agent/skills/screenshot-scene-view/SKILL.md | 73 +++ .agent/skills/script-delete/SKILL.md | 80 +++ .agent/skills/script-execute/SKILL.md | 198 +++++++ .agent/skills/script-read/SKILL.md | 97 ++++ .../skills/script-update-or-create/SKILL.md | 79 +++ .agent/skills/splines-add-knot/SKILL.md | 336 +++++++++++ .agent/skills/splines-add-spline/SKILL.md | 232 ++++++++ .../skills/splines-container-create/SKILL.md | 220 +++++++ .agent/skills/splines-evaluate/SKILL.md | 268 +++++++++ .agent/skills/splines-get-knots/SKILL.md | 293 ++++++++++ .agent/skills/splines-get/SKILL.md | 295 ++++++++++ .agent/skills/splines-insert-knot/SKILL.md | 342 +++++++++++ .agent/skills/splines-list/SKILL.md | 224 ++++++++ .agent/skills/splines-modify/SKILL.md | 307 ++++++++++ .agent/skills/splines-remove-knot/SKILL.md | 299 ++++++++++ .agent/skills/splines-set-closed/SKILL.md | 238 ++++++++ .agent/skills/splines-set-knot/SKILL.md | 342 +++++++++++ .../skills/splines-set-tangent-mode/SKILL.md | 306 ++++++++++ .agent/skills/terrain-add-layer/SKILL.md | 244 ++++++++ .agent/skills/terrain-create/SKILL.md | 261 +++++++++ .agent/skills/terrain-get-component/SKILL.md | 295 ++++++++++ .agent/skills/terrain-get/SKILL.md | 311 ++++++++++ .agent/skills/terrain-list/SKILL.md | 222 +++++++ .../skills/terrain-modify-component/SKILL.md | 307 ++++++++++ .agent/skills/terrain-paint-layer/SKILL.md | 271 +++++++++ .agent/skills/terrain-place-trees/SKILL.md | 304 ++++++++++ .agent/skills/terrain-remove-layer/SKILL.md | 223 +++++++ .agent/skills/terrain-sample-heights/SKILL.md | 285 +++++++++ .../terrain-set-detail-prototypes/SKILL.md | 236 ++++++++ .../terrain-set-heightmap-resolution/SKILL.md | 223 +++++++ .agent/skills/terrain-set-heights/SKILL.md | 277 +++++++++ .agent/skills/terrain-set-neighbors/SKILL.md | 248 ++++++++ .agent/skills/terrain-set-size/SKILL.md | 257 +++++++++ .../terrain-set-tree-prototypes/SKILL.md | 229 ++++++++ .agent/skills/tests-run/SKILL.md | 281 +++++++++ .agent/skills/tilemap-box-fill/SKILL.md | 284 +++++++++ .agent/skills/tilemap-clear/SKILL.md | 253 ++++++++ .../skills/tilemap-create-rule-tile/SKILL.md | 118 ++++ .../skills/tilemap-create-tile-asset/SKILL.md | 205 +++++++ .agent/skills/tilemap-create/SKILL.md | 267 +++++++++ .agent/skills/tilemap-get-tile/SKILL.md | 293 ++++++++++ .agent/skills/tilemap-get/SKILL.md | 295 ++++++++++ .agent/skills/tilemap-list/SKILL.md | 226 ++++++++ .agent/skills/tilemap-modify/SKILL.md | 307 ++++++++++ .../skills/tilemap-set-collider-type/SKILL.md | 260 +++++++++ .../skills/tilemap-set-orientation/SKILL.md | 294 ++++++++++ .agent/skills/tilemap-set-tile-flags/SKILL.md | 341 +++++++++++ .agent/skills/tilemap-set-tile/SKILL.md | 259 +++++++++ .agent/skills/timeline-clip-add/SKILL.md | 176 ++++++ .agent/skills/timeline-clip-move/SKILL.md | 167 ++++++ .../skills/timeline-clip-set-timing/SKILL.md | 220 +++++++ .agent/skills/timeline-create/SKILL.md | 134 +++++ .agent/skills/timeline-director-bind/SKILL.md | 241 ++++++++ .agent/skills/timeline-get/SKILL.md | 173 ++++++ .agent/skills/timeline-list/SKILL.md | 131 +++++ .agent/skills/timeline-marker-add/SKILL.md | 152 +++++ .agent/skills/timeline-modify/SKILL.md | 189 ++++++ .agent/skills/timeline-track-add/SKILL.md | 139 +++++ .agent/skills/timeline-track-bind/SKILL.md | 220 +++++++ .agent/skills/timeline-track-list/SKILL.md | 223 +++++++ .agent/skills/timeline-track-remove/SKILL.md | 128 +++++ .agent/skills/tool-set-enabled-state/SKILL.md | 172 ++++++ .agent/skills/type-get-json-schema/SKILL.md | 115 ++++ .agent/skills/unity-initial-setup/SKILL.md | 126 ++++ .agent/skills/unity-skill-create/SKILL.md | 208 +++++++ .agent/skills/unity-skill-generate/SKILL.md | 68 +++ .agent/skills/unity-tool-list/SKILL.md | 156 +++++ .gemini/settings.json | 4 +- .gemini/skills/navigation-agent-add/SKILL.md | 284 +++++++++ .../navigation-agent-set-destination/SKILL.md | 288 ++++++++++ .gemini/skills/navigation-get/SKILL.md | 295 ++++++++++ .gemini/skills/navigation-link-add/SKILL.md | 312 ++++++++++ .gemini/skills/navigation-list/SKILL.md | 246 ++++++++ .../skills/navigation-modifier-add/SKILL.md | 255 ++++++++ .../navigation-modifier-volume-add/SKILL.md | 284 +++++++++ .gemini/skills/navigation-modify/SKILL.md | 307 ++++++++++ .../navigation-set-bake-settings/SKILL.md | 249 ++++++++ .../skills/navigation-surface-add/SKILL.md | 294 ++++++++++ .../skills/navigation-surface-bake/SKILL.md | 227 ++++++++ .gemini/skills/particle-system-get/SKILL.md | 542 ++++++++++++++++++ .../skills/particle-system-modify/SKILL.md | 419 ++++++++++++++ .gemini/skills/probuilder-bevel/SKILL.md | 185 ++++++ .gemini/skills/probuilder-bridge/SKILL.md | 206 +++++++ .../skills/probuilder-connect-edges/SKILL.md | 215 +++++++ .../probuilder-create-poly-shape/SKILL.md | 288 ++++++++++ .../skills/probuilder-create-shape/SKILL.md | 246 ++++++++ .../skills/probuilder-delete-faces/SKILL.md | 206 +++++++ .gemini/skills/probuilder-extrude/SKILL.md | 229 ++++++++ .../skills/probuilder-flip-normals/SKILL.md | 197 +++++++ .../skills/probuilder-get-mesh-info/SKILL.md | 333 +++++++++++ .../skills/probuilder-merge-objects/SKILL.md | 241 ++++++++ .../probuilder-set-face-material/SKILL.md | 219 +++++++ .gemini/skills/probuilder-set-pivot/SKILL.md | 195 +++++++ .../probuilder-subdivide-edges/SKILL.md | 221 +++++++ .gemini/skills/splines-add-knot/SKILL.md | 336 +++++++++++ .gemini/skills/splines-add-spline/SKILL.md | 232 ++++++++ .../skills/splines-container-create/SKILL.md | 220 +++++++ .gemini/skills/splines-evaluate/SKILL.md | 268 +++++++++ .gemini/skills/splines-get-knots/SKILL.md | 293 ++++++++++ .gemini/skills/splines-get/SKILL.md | 295 ++++++++++ .gemini/skills/splines-insert-knot/SKILL.md | 342 +++++++++++ .gemini/skills/splines-list/SKILL.md | 224 ++++++++ .gemini/skills/splines-modify/SKILL.md | 307 ++++++++++ .gemini/skills/splines-remove-knot/SKILL.md | 299 ++++++++++ .gemini/skills/splines-set-closed/SKILL.md | 238 ++++++++ .gemini/skills/splines-set-knot/SKILL.md | 342 +++++++++++ .../skills/splines-set-tangent-mode/SKILL.md | 306 ++++++++++ .gemini/skills/terrain-add-layer/SKILL.md | 244 ++++++++ .gemini/skills/terrain-create/SKILL.md | 261 +++++++++ .gemini/skills/terrain-get-component/SKILL.md | 295 ++++++++++ .gemini/skills/terrain-get/SKILL.md | 311 ++++++++++ .gemini/skills/terrain-list/SKILL.md | 222 +++++++ .../skills/terrain-modify-component/SKILL.md | 307 ++++++++++ .gemini/skills/terrain-paint-layer/SKILL.md | 271 +++++++++ .gemini/skills/terrain-place-trees/SKILL.md | 304 ++++++++++ .gemini/skills/terrain-remove-layer/SKILL.md | 223 +++++++ .../skills/terrain-sample-heights/SKILL.md | 285 +++++++++ .../terrain-set-detail-prototypes/SKILL.md | 236 ++++++++ .../terrain-set-heightmap-resolution/SKILL.md | 223 +++++++ .gemini/skills/terrain-set-heights/SKILL.md | 277 +++++++++ .gemini/skills/terrain-set-neighbors/SKILL.md | 248 ++++++++ .gemini/skills/terrain-set-size/SKILL.md | 257 +++++++++ .../terrain-set-tree-prototypes/SKILL.md | 229 ++++++++ .gemini/skills/tilemap-box-fill/SKILL.md | 284 +++++++++ .gemini/skills/tilemap-clear/SKILL.md | 253 ++++++++ .../skills/tilemap-create-rule-tile/SKILL.md | 118 ++++ .../skills/tilemap-create-tile-asset/SKILL.md | 205 +++++++ .gemini/skills/tilemap-create/SKILL.md | 267 +++++++++ .gemini/skills/tilemap-get-tile/SKILL.md | 293 ++++++++++ .gemini/skills/tilemap-get/SKILL.md | 295 ++++++++++ .gemini/skills/tilemap-list/SKILL.md | 226 ++++++++ .gemini/skills/tilemap-modify/SKILL.md | 307 ++++++++++ .../skills/tilemap-set-collider-type/SKILL.md | 260 +++++++++ .../skills/tilemap-set-orientation/SKILL.md | 294 ++++++++++ .../skills/tilemap-set-tile-flags/SKILL.md | 341 +++++++++++ .gemini/skills/tilemap-set-tile/SKILL.md | 259 +++++++++ .gemini/skills/timeline-clip-add/SKILL.md | 176 ++++++ .gemini/skills/timeline-clip-move/SKILL.md | 167 ++++++ .../skills/timeline-clip-set-timing/SKILL.md | 220 +++++++ .gemini/skills/timeline-create/SKILL.md | 134 +++++ .../skills/timeline-director-bind/SKILL.md | 241 ++++++++ .gemini/skills/timeline-get/SKILL.md | 173 ++++++ .gemini/skills/timeline-list/SKILL.md | 131 +++++ .gemini/skills/timeline-marker-add/SKILL.md | 152 +++++ .gemini/skills/timeline-modify/SKILL.md | 189 ++++++ .gemini/skills/timeline-track-add/SKILL.md | 139 +++++ .gemini/skills/timeline-track-bind/SKILL.md | 220 +++++++ .gemini/skills/timeline-track-list/SKILL.md | 223 +++++++ .gemini/skills/timeline-track-remove/SKILL.md | 128 +++++ Packages/manifest.json | 9 +- Packages/packages-lock.json | 110 +++- .../com.unity.probuilder/Settings.json | 41 ++ 276 files changed, 60609 insertions(+), 6 deletions(-) create mode 100644 .agent/skills/animation-create/SKILL.md create mode 100644 .agent/skills/animation-get-data/SKILL.md create mode 100644 .agent/skills/animation-modify/SKILL.md create mode 100644 .agent/skills/animator-create/SKILL.md create mode 100644 .agent/skills/animator-get-data/SKILL.md create mode 100644 .agent/skills/animator-modify/SKILL.md create mode 100644 .agent/skills/assets-copy/SKILL.md create mode 100644 .agent/skills/assets-create-folder/SKILL.md create mode 100644 .agent/skills/assets-delete/SKILL.md create mode 100644 .agent/skills/assets-find-built-in/SKILL.md create mode 100644 .agent/skills/assets-find/SKILL.md create mode 100644 .agent/skills/assets-get-data/SKILL.md create mode 100644 .agent/skills/assets-material-create/SKILL.md create mode 100644 .agent/skills/assets-modify/SKILL.md create mode 100644 .agent/skills/assets-move/SKILL.md create mode 100644 .agent/skills/assets-prefab-close/SKILL.md create mode 100644 .agent/skills/assets-prefab-create/SKILL.md create mode 100644 .agent/skills/assets-prefab-instantiate/SKILL.md create mode 100644 .agent/skills/assets-prefab-open/SKILL.md create mode 100644 .agent/skills/assets-prefab-save/SKILL.md create mode 100644 .agent/skills/assets-refresh/SKILL.md create mode 100644 .agent/skills/assets-shader-get-data/SKILL.md create mode 100644 .agent/skills/assets-shader-list-all/SKILL.md create mode 100644 .agent/skills/cinemachine-add-extension/SKILL.md create mode 100644 .agent/skills/cinemachine-brain-ensure/SKILL.md create mode 100644 .agent/skills/cinemachine-camera-create/SKILL.md create mode 100644 .agent/skills/cinemachine-camera-get/SKILL.md create mode 100644 .agent/skills/cinemachine-camera-list/SKILL.md create mode 100644 .agent/skills/cinemachine-get/SKILL.md create mode 100644 .agent/skills/cinemachine-modify/SKILL.md create mode 100644 .agent/skills/cinemachine-set-aim/SKILL.md create mode 100644 .agent/skills/cinemachine-set-body/SKILL.md create mode 100644 .agent/skills/cinemachine-set-default-blend/SKILL.md create mode 100644 .agent/skills/cinemachine-set-lens/SKILL.md create mode 100644 .agent/skills/cinemachine-set-noise/SKILL.md create mode 100644 .agent/skills/cinemachine-set-priority/SKILL.md create mode 100644 .agent/skills/cinemachine-set-targets/SKILL.md create mode 100644 .agent/skills/console-clear-logs/SKILL.md create mode 100644 .agent/skills/console-get-logs/SKILL.md create mode 100644 .agent/skills/editor-application-get-state/SKILL.md create mode 100644 .agent/skills/editor-application-set-state/SKILL.md create mode 100644 .agent/skills/editor-selection-get/SKILL.md create mode 100644 .agent/skills/editor-selection-set/SKILL.md create mode 100644 .agent/skills/gameobject-component-add/SKILL.md create mode 100644 .agent/skills/gameobject-component-destroy/SKILL.md create mode 100644 .agent/skills/gameobject-component-get/SKILL.md create mode 100644 .agent/skills/gameobject-component-list-all/SKILL.md create mode 100644 .agent/skills/gameobject-component-modify/SKILL.md create mode 100644 .agent/skills/gameobject-create/SKILL.md create mode 100644 .agent/skills/gameobject-destroy/SKILL.md create mode 100644 .agent/skills/gameobject-duplicate/SKILL.md create mode 100644 .agent/skills/gameobject-find/SKILL.md create mode 100644 .agent/skills/gameobject-modify/SKILL.md create mode 100644 .agent/skills/gameobject-set-parent/SKILL.md create mode 100644 .agent/skills/inputsystem-action-add/SKILL.md create mode 100644 .agent/skills/inputsystem-action-remove/SKILL.md create mode 100644 .agent/skills/inputsystem-actionmap-add/SKILL.md create mode 100644 .agent/skills/inputsystem-actionmap-remove/SKILL.md create mode 100644 .agent/skills/inputsystem-asset-create/SKILL.md create mode 100644 .agent/skills/inputsystem-binding-add/SKILL.md create mode 100644 .agent/skills/inputsystem-binding-composite-add/SKILL.md create mode 100644 .agent/skills/inputsystem-binding-remove/SKILL.md create mode 100644 .agent/skills/inputsystem-binding-set/SKILL.md create mode 100644 .agent/skills/inputsystem-controlscheme-add/SKILL.md create mode 100644 .agent/skills/inputsystem-get/SKILL.md create mode 100644 .agent/skills/inputsystem-modify/SKILL.md create mode 100644 .agent/skills/inputsystem-save/SKILL.md create mode 100644 .agent/skills/navigation-agent-add/SKILL.md create mode 100644 .agent/skills/navigation-agent-set-destination/SKILL.md create mode 100644 .agent/skills/navigation-get/SKILL.md create mode 100644 .agent/skills/navigation-link-add/SKILL.md create mode 100644 .agent/skills/navigation-list/SKILL.md create mode 100644 .agent/skills/navigation-modifier-add/SKILL.md create mode 100644 .agent/skills/navigation-modifier-volume-add/SKILL.md create mode 100644 .agent/skills/navigation-modify/SKILL.md create mode 100644 .agent/skills/navigation-set-bake-settings/SKILL.md create mode 100644 .agent/skills/navigation-surface-add/SKILL.md create mode 100644 .agent/skills/navigation-surface-bake/SKILL.md create mode 100644 .agent/skills/object-get-data/SKILL.md create mode 100644 .agent/skills/object-modify/SKILL.md create mode 100644 .agent/skills/package-add/SKILL.md create mode 100644 .agent/skills/package-list/SKILL.md create mode 100644 .agent/skills/package-remove/SKILL.md create mode 100644 .agent/skills/package-search/SKILL.md create mode 100644 .agent/skills/particle-system-get/SKILL.md create mode 100644 .agent/skills/particle-system-modify/SKILL.md create mode 100644 .agent/skills/ping/SKILL.md create mode 100644 .agent/skills/probuilder-bevel/SKILL.md create mode 100644 .agent/skills/probuilder-bridge/SKILL.md create mode 100644 .agent/skills/probuilder-connect-edges/SKILL.md create mode 100644 .agent/skills/probuilder-create-poly-shape/SKILL.md create mode 100644 .agent/skills/probuilder-create-shape/SKILL.md create mode 100644 .agent/skills/probuilder-delete-faces/SKILL.md create mode 100644 .agent/skills/probuilder-extrude/SKILL.md create mode 100644 .agent/skills/probuilder-flip-normals/SKILL.md create mode 100644 .agent/skills/probuilder-get-mesh-info/SKILL.md create mode 100644 .agent/skills/probuilder-merge-objects/SKILL.md create mode 100644 .agent/skills/probuilder-set-face-material/SKILL.md create mode 100644 .agent/skills/probuilder-set-pivot/SKILL.md create mode 100644 .agent/skills/probuilder-subdivide-edges/SKILL.md create mode 100644 .agent/skills/profiler-capture-frame/SKILL.md create mode 100644 .agent/skills/profiler-clear-data/SKILL.md create mode 100644 .agent/skills/profiler-enable-module/SKILL.md create mode 100644 .agent/skills/profiler-get-memory-stats/SKILL.md create mode 100644 .agent/skills/profiler-get-rendering-stats/SKILL.md create mode 100644 .agent/skills/profiler-get-script-stats/SKILL.md create mode 100644 .agent/skills/profiler-get-status/SKILL.md create mode 100644 .agent/skills/profiler-list-modules/SKILL.md create mode 100644 .agent/skills/profiler-load-data/SKILL.md create mode 100644 .agent/skills/profiler-save-data/SKILL.md create mode 100644 .agent/skills/profiler-start/SKILL.md create mode 100644 .agent/skills/profiler-stop/SKILL.md create mode 100644 .agent/skills/reflection-method-call/SKILL.md create mode 100644 .agent/skills/reflection-method-find/SKILL.md create mode 100644 .agent/skills/scene-create/SKILL.md create mode 100644 .agent/skills/scene-get-data/SKILL.md create mode 100644 .agent/skills/scene-list-opened/SKILL.md create mode 100644 .agent/skills/scene-open/SKILL.md create mode 100644 .agent/skills/scene-save/SKILL.md create mode 100644 .agent/skills/scene-set-active/SKILL.md create mode 100644 .agent/skills/scene-unload/SKILL.md create mode 100644 .agent/skills/screenshot-camera/SKILL.md create mode 100644 .agent/skills/screenshot-game-view/SKILL.md create mode 100644 .agent/skills/screenshot-isolated/SKILL.md create mode 100644 .agent/skills/screenshot-scene-view/SKILL.md create mode 100644 .agent/skills/script-delete/SKILL.md create mode 100644 .agent/skills/script-execute/SKILL.md create mode 100644 .agent/skills/script-read/SKILL.md create mode 100644 .agent/skills/script-update-or-create/SKILL.md create mode 100644 .agent/skills/splines-add-knot/SKILL.md create mode 100644 .agent/skills/splines-add-spline/SKILL.md create mode 100644 .agent/skills/splines-container-create/SKILL.md create mode 100644 .agent/skills/splines-evaluate/SKILL.md create mode 100644 .agent/skills/splines-get-knots/SKILL.md create mode 100644 .agent/skills/splines-get/SKILL.md create mode 100644 .agent/skills/splines-insert-knot/SKILL.md create mode 100644 .agent/skills/splines-list/SKILL.md create mode 100644 .agent/skills/splines-modify/SKILL.md create mode 100644 .agent/skills/splines-remove-knot/SKILL.md create mode 100644 .agent/skills/splines-set-closed/SKILL.md create mode 100644 .agent/skills/splines-set-knot/SKILL.md create mode 100644 .agent/skills/splines-set-tangent-mode/SKILL.md create mode 100644 .agent/skills/terrain-add-layer/SKILL.md create mode 100644 .agent/skills/terrain-create/SKILL.md create mode 100644 .agent/skills/terrain-get-component/SKILL.md create mode 100644 .agent/skills/terrain-get/SKILL.md create mode 100644 .agent/skills/terrain-list/SKILL.md create mode 100644 .agent/skills/terrain-modify-component/SKILL.md create mode 100644 .agent/skills/terrain-paint-layer/SKILL.md create mode 100644 .agent/skills/terrain-place-trees/SKILL.md create mode 100644 .agent/skills/terrain-remove-layer/SKILL.md create mode 100644 .agent/skills/terrain-sample-heights/SKILL.md create mode 100644 .agent/skills/terrain-set-detail-prototypes/SKILL.md create mode 100644 .agent/skills/terrain-set-heightmap-resolution/SKILL.md create mode 100644 .agent/skills/terrain-set-heights/SKILL.md create mode 100644 .agent/skills/terrain-set-neighbors/SKILL.md create mode 100644 .agent/skills/terrain-set-size/SKILL.md create mode 100644 .agent/skills/terrain-set-tree-prototypes/SKILL.md create mode 100644 .agent/skills/tests-run/SKILL.md create mode 100644 .agent/skills/tilemap-box-fill/SKILL.md create mode 100644 .agent/skills/tilemap-clear/SKILL.md create mode 100644 .agent/skills/tilemap-create-rule-tile/SKILL.md create mode 100644 .agent/skills/tilemap-create-tile-asset/SKILL.md create mode 100644 .agent/skills/tilemap-create/SKILL.md create mode 100644 .agent/skills/tilemap-get-tile/SKILL.md create mode 100644 .agent/skills/tilemap-get/SKILL.md create mode 100644 .agent/skills/tilemap-list/SKILL.md create mode 100644 .agent/skills/tilemap-modify/SKILL.md create mode 100644 .agent/skills/tilemap-set-collider-type/SKILL.md create mode 100644 .agent/skills/tilemap-set-orientation/SKILL.md create mode 100644 .agent/skills/tilemap-set-tile-flags/SKILL.md create mode 100644 .agent/skills/tilemap-set-tile/SKILL.md create mode 100644 .agent/skills/timeline-clip-add/SKILL.md create mode 100644 .agent/skills/timeline-clip-move/SKILL.md create mode 100644 .agent/skills/timeline-clip-set-timing/SKILL.md create mode 100644 .agent/skills/timeline-create/SKILL.md create mode 100644 .agent/skills/timeline-director-bind/SKILL.md create mode 100644 .agent/skills/timeline-get/SKILL.md create mode 100644 .agent/skills/timeline-list/SKILL.md create mode 100644 .agent/skills/timeline-marker-add/SKILL.md create mode 100644 .agent/skills/timeline-modify/SKILL.md create mode 100644 .agent/skills/timeline-track-add/SKILL.md create mode 100644 .agent/skills/timeline-track-bind/SKILL.md create mode 100644 .agent/skills/timeline-track-list/SKILL.md create mode 100644 .agent/skills/timeline-track-remove/SKILL.md create mode 100644 .agent/skills/tool-set-enabled-state/SKILL.md create mode 100644 .agent/skills/type-get-json-schema/SKILL.md create mode 100644 .agent/skills/unity-initial-setup/SKILL.md create mode 100644 .agent/skills/unity-skill-create/SKILL.md create mode 100644 .agent/skills/unity-skill-generate/SKILL.md create mode 100644 .agent/skills/unity-tool-list/SKILL.md create mode 100644 .gemini/skills/navigation-agent-add/SKILL.md create mode 100644 .gemini/skills/navigation-agent-set-destination/SKILL.md create mode 100644 .gemini/skills/navigation-get/SKILL.md create mode 100644 .gemini/skills/navigation-link-add/SKILL.md create mode 100644 .gemini/skills/navigation-list/SKILL.md create mode 100644 .gemini/skills/navigation-modifier-add/SKILL.md create mode 100644 .gemini/skills/navigation-modifier-volume-add/SKILL.md create mode 100644 .gemini/skills/navigation-modify/SKILL.md create mode 100644 .gemini/skills/navigation-set-bake-settings/SKILL.md create mode 100644 .gemini/skills/navigation-surface-add/SKILL.md create mode 100644 .gemini/skills/navigation-surface-bake/SKILL.md create mode 100644 .gemini/skills/particle-system-get/SKILL.md create mode 100644 .gemini/skills/particle-system-modify/SKILL.md create mode 100644 .gemini/skills/probuilder-bevel/SKILL.md create mode 100644 .gemini/skills/probuilder-bridge/SKILL.md create mode 100644 .gemini/skills/probuilder-connect-edges/SKILL.md create mode 100644 .gemini/skills/probuilder-create-poly-shape/SKILL.md create mode 100644 .gemini/skills/probuilder-create-shape/SKILL.md create mode 100644 .gemini/skills/probuilder-delete-faces/SKILL.md create mode 100644 .gemini/skills/probuilder-extrude/SKILL.md create mode 100644 .gemini/skills/probuilder-flip-normals/SKILL.md create mode 100644 .gemini/skills/probuilder-get-mesh-info/SKILL.md create mode 100644 .gemini/skills/probuilder-merge-objects/SKILL.md create mode 100644 .gemini/skills/probuilder-set-face-material/SKILL.md create mode 100644 .gemini/skills/probuilder-set-pivot/SKILL.md create mode 100644 .gemini/skills/probuilder-subdivide-edges/SKILL.md create mode 100644 .gemini/skills/splines-add-knot/SKILL.md create mode 100644 .gemini/skills/splines-add-spline/SKILL.md create mode 100644 .gemini/skills/splines-container-create/SKILL.md create mode 100644 .gemini/skills/splines-evaluate/SKILL.md create mode 100644 .gemini/skills/splines-get-knots/SKILL.md create mode 100644 .gemini/skills/splines-get/SKILL.md create mode 100644 .gemini/skills/splines-insert-knot/SKILL.md create mode 100644 .gemini/skills/splines-list/SKILL.md create mode 100644 .gemini/skills/splines-modify/SKILL.md create mode 100644 .gemini/skills/splines-remove-knot/SKILL.md create mode 100644 .gemini/skills/splines-set-closed/SKILL.md create mode 100644 .gemini/skills/splines-set-knot/SKILL.md create mode 100644 .gemini/skills/splines-set-tangent-mode/SKILL.md create mode 100644 .gemini/skills/terrain-add-layer/SKILL.md create mode 100644 .gemini/skills/terrain-create/SKILL.md create mode 100644 .gemini/skills/terrain-get-component/SKILL.md create mode 100644 .gemini/skills/terrain-get/SKILL.md create mode 100644 .gemini/skills/terrain-list/SKILL.md create mode 100644 .gemini/skills/terrain-modify-component/SKILL.md create mode 100644 .gemini/skills/terrain-paint-layer/SKILL.md create mode 100644 .gemini/skills/terrain-place-trees/SKILL.md create mode 100644 .gemini/skills/terrain-remove-layer/SKILL.md create mode 100644 .gemini/skills/terrain-sample-heights/SKILL.md create mode 100644 .gemini/skills/terrain-set-detail-prototypes/SKILL.md create mode 100644 .gemini/skills/terrain-set-heightmap-resolution/SKILL.md create mode 100644 .gemini/skills/terrain-set-heights/SKILL.md create mode 100644 .gemini/skills/terrain-set-neighbors/SKILL.md create mode 100644 .gemini/skills/terrain-set-size/SKILL.md create mode 100644 .gemini/skills/terrain-set-tree-prototypes/SKILL.md create mode 100644 .gemini/skills/tilemap-box-fill/SKILL.md create mode 100644 .gemini/skills/tilemap-clear/SKILL.md create mode 100644 .gemini/skills/tilemap-create-rule-tile/SKILL.md create mode 100644 .gemini/skills/tilemap-create-tile-asset/SKILL.md create mode 100644 .gemini/skills/tilemap-create/SKILL.md create mode 100644 .gemini/skills/tilemap-get-tile/SKILL.md create mode 100644 .gemini/skills/tilemap-get/SKILL.md create mode 100644 .gemini/skills/tilemap-list/SKILL.md create mode 100644 .gemini/skills/tilemap-modify/SKILL.md create mode 100644 .gemini/skills/tilemap-set-collider-type/SKILL.md create mode 100644 .gemini/skills/tilemap-set-orientation/SKILL.md create mode 100644 .gemini/skills/tilemap-set-tile-flags/SKILL.md create mode 100644 .gemini/skills/tilemap-set-tile/SKILL.md create mode 100644 .gemini/skills/timeline-clip-add/SKILL.md create mode 100644 .gemini/skills/timeline-clip-move/SKILL.md create mode 100644 .gemini/skills/timeline-clip-set-timing/SKILL.md create mode 100644 .gemini/skills/timeline-create/SKILL.md create mode 100644 .gemini/skills/timeline-director-bind/SKILL.md create mode 100644 .gemini/skills/timeline-get/SKILL.md create mode 100644 .gemini/skills/timeline-list/SKILL.md create mode 100644 .gemini/skills/timeline-marker-add/SKILL.md create mode 100644 .gemini/skills/timeline-modify/SKILL.md create mode 100644 .gemini/skills/timeline-track-add/SKILL.md create mode 100644 .gemini/skills/timeline-track-bind/SKILL.md create mode 100644 .gemini/skills/timeline-track-list/SKILL.md create mode 100644 .gemini/skills/timeline-track-remove/SKILL.md create mode 100644 ProjectSettings/Packages/com.unity.probuilder/Settings.json diff --git a/.agent/skills/animation-create/SKILL.md b/.agent/skills/animation-create/SKILL.md new file mode 100644 index 0000000..412d8b5 --- /dev/null +++ b/.agent/skills/animation-create/SKILL.md @@ -0,0 +1,139 @@ +--- +name: animation-create +description: Create empty Unity `AnimationClip` assets at the given project paths. Each path must start with `Assets/` and end with `.anim`. Missing intermediate folders are created recursively. Pair with 'animation-modify' to populate curves and events. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animation / Create + +Create empty Unity `AnimationClip` assets at the given project paths. Each path must start with `Assets/` and end with `.anim`. Missing intermediate folders are created recursively, then `AssetDatabase.Refresh()` runs and the Editor windows repaint. Pair with 'animation-modify' to populate curves and events afterwards. + +## Inputs + +- `sourcePaths` — array of project-relative `.anim` paths to create. + +## Behavior + +Each path is validated independently: empty / non-`Assets/` / non-`.anim` paths are skipped and appended to `errors` instead of aborting the whole batch. Successfully created clips are returned in `createdAssets` with their path, instance ID, and name. + +## How to Call + +```bash +unity-mcp-cli run-tool animation-create --input '{ + "sourcePaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animation-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animation-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sourcePaths` | `any` | Yes | The paths of the animation assets to create. Each path should start with 'Assets/' and end with '.anim'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sourcePaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "sourcePaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreateAnimationResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreatedAnimationInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreatedAnimationInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreatedAnimationInfo": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "instanceId" + ] + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreateAnimationResponse": { + "type": "object", + "properties": { + "createdAssets": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CreatedAnimationInfo)" + }, + "errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/animation-get-data/SKILL.md b/.agent/skills/animation-get-data/SKILL.md new file mode 100644 index 0000000..48d1981 --- /dev/null +++ b/.agent/skills/animation-get-data/SKILL.md @@ -0,0 +1,254 @@ +--- +name: animation-get-data +description: Inspect a Unity `AnimationClip` asset — name, length, frame rate, wrap mode, looping/legacy/humanMotion flags, local bounds, and the full set of float curves, object-reference curves, and events. Pair with 'animation-modify' to write changes back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animation / Get Data + +Inspect a Unity `AnimationClip` asset. Returns the high-level clip metadata plus the complete set of float curve bindings, object-reference curve bindings, and animation events. Pair with 'animation-modify' to write changes back. + +## Inputs + +- `animRef` — reference to the `AnimationClip` asset (path must start with `Assets/` and end with `.anim`). + +## Returned fields + +- `name`, `length`, `frameRate`, `wrapMode`, `isLooping`, `hasGenericRootTransform`, `hasMotionCurves`, `hasMotionFloatCurves`, `hasRootCurves`, `humanMotion`, `legacy`, `localBounds`, `empty`. +- `curveBindings` — float curve bindings (`path`, `propertyName`, `type`, `isPPtrCurve`, `isDiscreteCurve`, `keyframeCount`). +- `objectReferenceBindings` — object-reference curve bindings (same shape as `curveBindings`). +- `events` — animation events (`time`, `functionName`, `intParameter`, `floatParameter`, `stringParameter`). + +## How to Call + +```bash +unity-mcp-cli run-tool animation-get-data --input '{ + "animRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animation-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animation-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `animRef` | `any` | Yes | Reference to the animation asset. The path should start with 'Assets/' and end with '.anim'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "animRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "animRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-GetDataResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CurveBindingInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CurveBindingInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CurveBindingInfo": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "propertyName": { + "type": "string" + }, + "type": { + "type": "string" + }, + "isPPtrCurve": { + "type": "boolean" + }, + "isDiscreteCurve": { + "type": "boolean" + }, + "keyframeCount": { + "type": "integer" + } + }, + "required": [ + "isPPtrCurve", + "isDiscreteCurve", + "keyframeCount" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-AnimationEventInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-AnimationEventInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-AnimationEventInfo": { + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "functionName": { + "type": "string" + }, + "intParameter": { + "type": "integer" + }, + "floatParameter": { + "type": "number" + }, + "stringParameter": { + "type": "string" + } + }, + "required": [ + "time", + "intParameter", + "floatParameter" + ] + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-GetDataResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "length": { + "type": "number" + }, + "frameRate": { + "type": "number" + }, + "wrapMode": { + "type": "string" + }, + "isLooping": { + "type": "boolean" + }, + "hasGenericRootTransform": { + "type": "boolean" + }, + "hasMotionCurves": { + "type": "boolean" + }, + "hasMotionFloatCurves": { + "type": "boolean" + }, + "hasRootCurves": { + "type": "boolean" + }, + "humanMotion": { + "type": "boolean" + }, + "legacy": { + "type": "boolean" + }, + "localBounds": { + "type": "string" + }, + "empty": { + "type": "boolean" + }, + "curveBindings": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CurveBindingInfo)" + }, + "objectReferenceBindings": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-CurveBindingInfo)" + }, + "events": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimationTools-AnimationEventInfo)" + } + }, + "required": [ + "length", + "frameRate", + "isLooping", + "hasGenericRootTransform", + "hasMotionCurves", + "hasMotionFloatCurves", + "hasRootCurves", + "humanMotion", + "legacy", + "empty" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/animation-modify/SKILL.md b/.agent/skills/animation-modify/SKILL.md new file mode 100644 index 0000000..597a335 --- /dev/null +++ b/.agent/skills/animation-modify/SKILL.md @@ -0,0 +1,310 @@ +--- +name: animation-modify +description: Apply a batch of modifications to a Unity `AnimationClip` — set/remove float curves, clear all curves, set frame rate / wrap mode / legacy flag, add or clear animation events. Use 'animation-get-data' first to discover valid curve bindings. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animation / Modify + +Apply a batch of modifications to a Unity `AnimationClip` asset. Each modification is dispatched by its `ModificationType` discriminator. Use 'animation-get-data' first to discover valid property names and existing curves so the diff is targeted. + +## Inputs + +- `animRef` — reference to the `AnimationClip` asset (path must start with `Assets/` and end with `.anim`). +- `modifications` — array of `AnimationModification` entries. + +## Supported modification types + +- `SetCurve` — add or replace a float animation curve (`path`, `propertyName`, `type`, `keyframes`). +- `RemoveCurve` — remove a specific binding. +- `ClearCurves` — remove every curve from the clip. +- `SetFrameRate` — set the clip's frame rate. +- `SetWrapMode` — set the clip's `WrapMode`. +- `SetLegacy` — toggle the legacy animation flag. +- `AddEvent` — append an animation event (`time`, `functionName`, `intParameter`, `floatParameter`, `stringParameter`). +- `ClearEvents` — remove every animation event. + +## Behavior + +Per-modification errors are accumulated in the response's `errors` array instead of aborting the whole batch. Events are applied as a single rewrite after all per-entry mutations finish. + +## How to Call + +```bash +unity-mcp-cli run-tool animation-modify --input '{ + "animRef": "string_value", + "modifications": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animation-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animation-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `animRef` | `any` | Yes | Reference to the AnimationClip asset to modify. | +| `modifications` | `any` | Yes | Array of modifications to apply to the clip. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "animRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "modifications": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationModification-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationModification": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "SetCurve", + "RemoveCurve", + "ClearCurves", + "SetFrameRate", + "SetWrapMode", + "SetLegacy", + "AddEvent", + "ClearEvents" + ], + "description": "Modification type. Properties below are used conditionally based on this value." + }, + "relativePath": { + "type": "string", + "description": "Path to target GameObject relative to the root (empty for root). Used by: SetCurve, RemoveCurve." + }, + "componentType": { + "type": "string", + "description": "Component type name (e.g., 'Transform', 'SpriteRenderer'). Required for: SetCurve, RemoveCurve." + }, + "propertyName": { + "type": "string", + "description": "Property to animate (e.g., 'localPosition.x', 'm_LocalScale.y'). Required for: SetCurve, RemoveCurve." + }, + "keyframes": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationKeyframe-1", + "description": "Keyframes for the curve. Required for: SetCurve." + }, + "frameRate": { + "type": "number", + "description": "Frames per second. Required for: SetFrameRate." + }, + "wrapMode": { + "type": "string", + "enum": [ + "Default", + "Clamp", + "Clamp", + "Loop", + "PingPong", + "ClampForever" + ], + "description": "How animation behaves at boundaries. Required for: SetWrapMode." + }, + "legacy": { + "type": "boolean", + "description": "Use legacy animation system. Required for: SetLegacy." + }, + "time": { + "type": "number", + "description": "Event trigger time in seconds. Required for: AddEvent." + }, + "functionName": { + "type": "string", + "description": "Function to invoke. Required for: AddEvent." + }, + "stringParameter": { + "type": "string", + "description": "String parameter passed to the function. Optional for: AddEvent." + }, + "floatParameter": { + "type": "number", + "description": "Float parameter passed to the function. Optional for: AddEvent." + }, + "intParameter": { + "type": "integer", + "description": "Integer parameter passed to the function. Optional for: AddEvent." + } + }, + "required": [ + "type" + ] + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationKeyframe-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationKeyframe" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationKeyframe": { + "type": "object", + "properties": { + "time": { + "type": "number", + "description": "Time in seconds." + }, + "value": { + "type": "number", + "description": "Value at this keyframe." + }, + "inTangent": { + "type": "number", + "description": "Incoming tangent (slope). Default: 0." + }, + "outTangent": { + "type": "number", + "description": "Outgoing tangent (slope). Default: 0." + }, + "weightedMode": { + "type": "string", + "enum": [ + "None", + "In", + "Out", + "Both" + ], + "description": "Weighted mode: None (0), In (1), Out (2), Both (3). Default: None." + }, + "inWeight": { + "type": "number", + "description": "Incoming weight. Default: 0.33." + }, + "outWeight": { + "type": "number", + "description": "Outgoing weight. Default: 0.33." + } + }, + "required": [ + "time", + "value" + ] + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationModification-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationModification" + } + } + }, + "required": [ + "animRef", + "modifications" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-ModifyAnimationResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-ModifyAnimationInfo": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "instanceId" + ] + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimationTools-ModifyAnimationResponse": { + "type": "object", + "properties": { + "modifiedAsset": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimationTools-ModifyAnimationInfo" + }, + "errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/animator-create/SKILL.md b/.agent/skills/animator-create/SKILL.md new file mode 100644 index 0000000..61d98d1 --- /dev/null +++ b/.agent/skills/animator-create/SKILL.md @@ -0,0 +1,139 @@ +--- +name: animator-create +description: Create empty Unity `AnimatorController` assets at the given project paths. Each path must start with `Assets/` and end with `.controller`. Missing intermediate folders are created recursively. Pair with 'animator-modify' to add layers/states/parameters. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animator / Create + +Create empty Unity `AnimatorController` assets at the given project paths. Each path must start with `Assets/` and end with `.controller`. Missing intermediate folders are created recursively, then `AssetDatabase.Refresh()` runs and the Editor windows repaint. Pair with 'animator-modify' to add layers, states, parameters, and transitions afterwards. + +## Inputs + +- `sourcePaths` — array of project-relative `.controller` paths to create. + +## Behavior + +Each path is validated independently: empty / non-`Assets/` / non-`.controller` paths are skipped and appended to `errors` instead of aborting the whole batch. Successfully created controllers are returned in `createdAssets` with their path, instance ID, and name. + +## How to Call + +```bash +unity-mcp-cli run-tool animator-create --input '{ + "sourcePaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animator-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animator-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sourcePaths` | `any` | Yes | The paths of the animator controller assets to create. Each path should start with 'Assets/' and end with '.controller'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sourcePaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "sourcePaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreateAnimatorResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreatedAnimatorInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreatedAnimatorInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreatedAnimatorInfo": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "instanceId" + ] + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreateAnimatorResponse": { + "type": "object", + "properties": { + "createdAssets": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-CreatedAnimatorInfo)" + }, + "errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/animator-get-data/SKILL.md b/.agent/skills/animator-get-data/SKILL.md new file mode 100644 index 0000000..3fb7f0d --- /dev/null +++ b/.agent/skills/animator-get-data/SKILL.md @@ -0,0 +1,347 @@ +--- +name: animator-get-data +description: Inspect a Unity `AnimatorController` asset — controller name, every parameter (name, type, defaults), every layer with its state machine, every state, and every transition. Pair with 'animator-modify' to write changes back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animator / Get Data + +Inspect a Unity `AnimatorController` asset. Returns the controller's name plus the full set of parameters, layers, states, and transitions — enough to drive a follow-up 'animator-modify' call with valid names. + +## Inputs + +- `animatorRef` — reference to the `AnimatorController` asset (path must start with `Assets/` and end with `.controller`). + +## Returned fields + +- `name` — controller asset name. +- `parameters` — every parameter (name, type, default value). +- `layers` — every layer with its state machine, default state, and weight. +- `states` — every state across all layers (name, speed, motion). +- `transitions` — every transition with its conditions, source, and destination. + +## How to Call + +```bash +unity-mcp-cli run-tool animator-get-data --input '{ + "animatorRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animator-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animator-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `animatorRef` | `any` | Yes | Reference to the AnimatorController asset. The path should start with 'Assets/' and end with '.controller'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "animatorRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "animatorRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-GetAnimatorDataResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorParameterInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorParameterInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorParameterInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "defaultFloat": { + "type": "number" + }, + "defaultInt": { + "type": "integer" + }, + "defaultBool": { + "type": "boolean" + } + }, + "required": [ + "defaultFloat", + "defaultInt", + "defaultBool" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorLayerInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorLayerInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorLayerInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "defaultWeight": { + "type": "number" + }, + "blendingMode": { + "type": "string" + }, + "syncedLayerIndex": { + "type": "integer" + }, + "iKPass": { + "type": "boolean" + }, + "defaultStateName": { + "type": "string" + }, + "states": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorStateInfo)" + }, + "subStateMachines": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "anyStateTransitions": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorTransitionInfo)" + } + }, + "required": [ + "defaultWeight", + "syncedLayerIndex", + "iKPass" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorStateInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorStateInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorStateInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "speed": { + "type": "number" + }, + "speedParameterActive": { + "type": "boolean" + }, + "speedParameter": { + "type": "string" + }, + "cycleOffset": { + "type": "number" + }, + "cycleOffsetParameterActive": { + "type": "boolean" + }, + "cycleOffsetParameter": { + "type": "string" + }, + "mirror": { + "type": "boolean" + }, + "mirrorParameterActive": { + "type": "boolean" + }, + "mirrorParameter": { + "type": "string" + }, + "writeDefaultValues": { + "type": "boolean" + }, + "motionName": { + "type": "string" + }, + "transitions": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorTransitionInfo)" + } + }, + "required": [ + "speed", + "speedParameterActive", + "cycleOffset", + "cycleOffsetParameterActive", + "mirror", + "mirrorParameterActive", + "writeDefaultValues" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorTransitionInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorTransitionInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorTransitionInfo": { + "type": "object", + "properties": { + "destinationStateName": { + "type": "string" + }, + "hasExitTime": { + "type": "boolean" + }, + "exitTime": { + "type": "number" + }, + "hasFixedDuration": { + "type": "boolean" + }, + "duration": { + "type": "number" + }, + "offset": { + "type": "number" + }, + "canTransitionToSelf": { + "type": "boolean" + }, + "conditions": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionInfo)" + } + }, + "required": [ + "hasExitTime", + "exitTime", + "hasFixedDuration", + "duration", + "offset", + "canTransitionToSelf" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionInfo": { + "type": "object", + "properties": { + "parameter": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "threshold": { + "type": "number" + } + }, + "required": [ + "threshold" + ] + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-GetAnimatorDataResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorParameterInfo)" + }, + "layers": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Animation.AnimatorLayerInfo)" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/animator-modify/SKILL.md b/.agent/skills/animator-modify/SKILL.md new file mode 100644 index 0000000..7d051be --- /dev/null +++ b/.agent/skills/animator-modify/SKILL.md @@ -0,0 +1,296 @@ +--- +name: animator-modify +description: Apply a batch of modifications to a Unity `AnimatorController` — add/remove parameters, layers, states, and transitions; set default states; set state motion/speed. Use 'animator-get-data' first to discover valid names. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Animator / Modify + +Apply a batch of modifications to a Unity `AnimatorController` asset. Each modification is dispatched by its `AnimatorModificationType` discriminator. Use 'animator-get-data' first to discover valid names so the diff is targeted. + +## Inputs + +- `animatorRef` — reference to the `AnimatorController` asset (path must start with `Assets/` and end with `.controller`). +- `modifications` — array of `AnimatorModification` entries. + +## Supported modification types + +- `AddParameter` / `RemoveParameter` — manage controller parameters (float, int, bool, trigger). +- `AddLayer` / `RemoveLayer` — manage animator layers. +- `AddState` / `RemoveState` — manage states inside a specific layer. +- `SetDefaultState` — pick the default state for a layer. +- `AddTransition` / `RemoveTransition` — manage state-to-state transitions. +- `AddAnyStateTransition` — add a transition from Any State. +- `SetStateMotion` — assign an `AnimationClip` as a state's motion. +- `SetStateSpeed` — set a state's speed multiplier. + +## Behavior + +Per-modification errors are accumulated in the response's `errors` array instead of aborting the whole batch. The controller asset is marked dirty and saved after the modifications complete. + +## How to Call + +```bash +unity-mcp-cli run-tool animator-modify --input '{ + "animatorRef": "string_value", + "modifications": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool animator-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool animator-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `animatorRef` | `any` | Yes | Reference to the AnimatorController asset to modify. | +| `modifications` | `any` | Yes | Array of modifications to apply to the controller. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "animatorRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "modifications": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorModification-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorModification": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "AddParameter", + "RemoveParameter", + "AddLayer", + "RemoveLayer", + "AddState", + "RemoveState", + "SetDefaultState", + "AddTransition", + "RemoveTransition", + "AddAnyStateTransition", + "SetStateMotion", + "SetStateSpeed" + ], + "description": "Modification type. Properties below are used conditionally based on this value." + }, + "parameterName": { + "type": "string", + "description": "Parameter name. Required for: AddParameter, RemoveParameter." + }, + "parameterType": { + "type": "string", + "description": "Parameter type: Float, Int, Bool, Trigger. Required for: AddParameter." + }, + "defaultFloat": { + "type": "number", + "description": "Default float value. Optional for: AddParameter (Float type)." + }, + "defaultInt": { + "type": "integer", + "description": "Default int value. Optional for: AddParameter (Int type)." + }, + "defaultBool": { + "type": "boolean", + "description": "Default bool value. Optional for: AddParameter (Bool type)." + }, + "layerName": { + "type": "string", + "description": "Layer name. Required for: AddLayer, RemoveLayer, AddState, RemoveState, SetDefaultState, AddTransition, RemoveTransition, AddAnyStateTransition, SetStateMotion, SetStateSpeed." + }, + "stateName": { + "type": "string", + "description": "State name. Required for: AddState, RemoveState, SetDefaultState, SetStateMotion, SetStateSpeed." + }, + "motionAssetPath": { + "type": "string", + "description": "Asset path to AnimationClip. Optional for: AddState. Required for: SetStateMotion." + }, + "speed": { + "type": "number", + "description": "Speed multiplier. Required for: SetStateSpeed." + }, + "sourceStateName": { + "type": "string", + "description": "Source state name. Required for: AddTransition, RemoveTransition." + }, + "destinationStateName": { + "type": "string", + "description": "Destination state name. Required for: AddTransition, RemoveTransition, AddAnyStateTransition." + }, + "hasExitTime": { + "type": "boolean", + "description": "Whether transition waits for exit time. Optional for: AddTransition, AddAnyStateTransition." + }, + "exitTime": { + "type": "number", + "description": "Normalized exit time (0-1). Optional for: AddTransition, AddAnyStateTransition." + }, + "duration": { + "type": "number", + "description": "Transition blend duration. Optional for: AddTransition, AddAnyStateTransition." + }, + "hasFixedDuration": { + "type": "boolean", + "description": "Whether duration is in seconds (true) or normalized (false). Optional for: AddTransition, AddAnyStateTransition." + }, + "conditions": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionData-1", + "description": "Transition conditions. Optional for: AddTransition, AddAnyStateTransition." + } + }, + "required": [ + "type" + ] + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionData-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionData" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorConditionData": { + "type": "object", + "properties": { + "parameter": { + "type": "string", + "description": "Parameter name for the condition." + }, + "mode": { + "type": "string", + "description": "Condition mode: If, IfNot, Greater, Less, Equals, NotEqual." + }, + "threshold": { + "type": "number", + "description": "Threshold value for the condition." + } + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorModification-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorModification" + } + } + }, + "required": [ + "animatorRef", + "modifications" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-ModifyAnimatorResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Animation.ModifyAnimatorInfo": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "instanceId" + ] + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Animation.AnimatorTools-ModifyAnimatorResponse": { + "type": "object", + "properties": { + "modifiedAsset": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Animation.ModifyAnimatorInfo" + }, + "errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-copy/SKILL.md b/.agent/skills/assets-copy/SKILL.md new file mode 100644 index 0000000..80f3415 --- /dev/null +++ b/.agent/skills/assets-copy/SKILL.md @@ -0,0 +1,160 @@ +--- +name: assets-copy +description: Copy assets at given paths and store them at new paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the source assets first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Copy + +Copy assets at given paths and store them at new paths. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before copying. + +## Inputs + +- `sourcePaths` — paths of the assets to copy. +- `destinationPaths` — paths to store the copied assets (must match `sourcePaths` length). + +## Behavior + +Each source/destination pair is copied in order. Per-pair errors are accumulated in the response instead of throwing, so a single bad pair does not abort the whole batch. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-copy --input '{ + "sourcePaths": "string_value", + "destinationPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-copy --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-copy --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sourcePaths` | `any` | Yes | The paths of the assets to copy. | +| `destinationPaths` | `any` | Yes | The paths to store the copied assets. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sourcePaths": { + "$ref": "#/$defs/System.String-1" + }, + "destinationPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "sourcePaths", + "destinationPaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.CopyAssetsResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(AIGD.AssetObjectRef)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.CopyAssetsResponse": { + "type": "object", + "properties": { + "CopiedAssets": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)", + "description": "List of copied assets." + }, + "Errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of errors encountered during copy operations." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-create-folder/SKILL.md b/.agent/skills/assets-create-folder/SKILL.md new file mode 100644 index 0000000..60135b1 --- /dev/null +++ b/.agent/skills/assets-create-folder/SKILL.md @@ -0,0 +1,129 @@ +--- +name: assets-create-folder +description: Create a new folder under a parent folder inside 'Assets/'. The parent path must start with 'Assets/' and every intermediate folder in it must already exist. Refreshes the AssetDatabase at the end and returns the GUID(s) of the created folder(s). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Create Folder + +Creates a new folder in the specified parent folder. The parent folder string must start with the 'Assets' folder, and all folders within the parent folder string must already exist. For example, when specifying 'Assets/ParentFolder1/ParentFolder2/', the new folder will be created in 'ParentFolder2' only if ParentFolder1 and ParentFolder2 already exist. Use it to organize scripts and assets in the project. Does AssetDatabase.Refresh() at the end. Returns the GUID of the newly created folder, if successful. + +## Inputs + +- `inputs` — list of `{ParentFolderPath, NewFolderName}` entries. Each entry is processed independently; per-entry errors are collected in the response so a single bad input does not abort the batch. + +## Validation + +- `NewFolderName` must be non-empty and must not contain any of `/`, `\`, `<`, `>`, `:`, `"`, `|`, `?`, `*`, or control characters (these checks are cross-platform even on Linux/Mac). +- `ParentFolderPath` must already exist as an `AssetDatabase.IsValidFolder` path. +- A folder with the same target name must not already exist under the parent. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-create-folder --input '{ + "inputs": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-create-folder --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-create-folder --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `inputs` | `any` | Yes | The paths for the folders to create. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "inputs": { + "$ref": "#/$defs/AIGD.CreateFolderInput-1" + } + }, + "$defs": { + "AIGD.CreateFolderInput": { + "type": "object", + "properties": { + "ParentFolderPath": { + "type": "string", + "description": "The parent folder path where the new folder will be created." + }, + "NewFolderName": { + "type": "string", + "description": "The name of the new folder to create." + } + } + }, + "AIGD.CreateFolderInput-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.CreateFolderInput" + } + } + }, + "required": [ + "inputs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.CreateFolderResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.CreateFolderResponse": { + "type": "object", + "properties": { + "CreatedFolderGuids": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of GUIDs of created folders." + }, + "Errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of errors encountered during folder creation." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-delete/SKILL.md b/.agent/skills/assets-delete/SKILL.md new file mode 100644 index 0000000..57ba428 --- /dev/null +++ b/.agent/skills/assets-delete/SKILL.md @@ -0,0 +1,114 @@ +--- +name: assets-delete +description: Delete the assets at the given project paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the assets first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Delete + +Delete the assets at paths from the project. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before deleting. + +## Inputs + +- `paths` — project-relative asset paths to delete. Must be non-empty. + +## Behavior + +Routes through `AssetDatabase.DeleteAssets`, which deletes the batch atomically. Paths Unity reports as failed are surfaced in `response.Errors`; successfully deleted paths are surfaced in `response.DeletedPaths`. The tool is destructive (removes files from disk). + +## How to Call + +```bash +unity-mcp-cli run-tool assets-delete --input '{ + "paths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-delete --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-delete --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `paths` | `any` | Yes | The paths of the assets | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "paths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "paths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.DeleteAssetsResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.DeleteAssetsResponse": { + "type": "object", + "properties": { + "DeletedPaths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of paths of deleted assets." + }, + "Errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of errors encountered during delete operations." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-find-built-in/SKILL.md b/.agent/skills/assets-find-built-in/SKILL.md new file mode 100644 index 0000000..4d0fdd5 --- /dev/null +++ b/.agent/skills/assets-find-built-in/SKILL.md @@ -0,0 +1,140 @@ +--- +name: assets-find-built-in +description: Search the built-in assets of the Unity Editor (located at Resources/unity_builtin_extra). Filters by name and/or type; built-in assets have no GUID so GUID-based lookups are not supported. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Find (Built-in) + +Search the built-in assets of the Unity Editor located in the built-in resources: Resources/unity_builtin_extra. Doesn't support GUIDs since built-in assets do not have them. + +## Inputs + +- `name` (optional) — case-insensitive name fragment. Underscores, hyphens, spaces, and periods delimit search words so partial-word matching works. +- `type` (optional) — restrict results to assets assignable to this type (e.g. `UnityEngine.Texture2D`). +- `maxResults` — cap on returned list size (default 10). + +## Ranking + +Results are sorted by descending match quality: exact match → substring match → all-words match → partial-words match. Within a rank, results are sorted alphabetically by filename for stable ordering. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-find-built-in --input '{ + "name": "string_value", + "type": "string_value", + "maxResults": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-find-built-in --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-find-built-in --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | The name of the asset to filter by. | +| `type` | `any` | No | The type of the asset to filter by. | +| `maxResults` | `integer` | No | Maximum number of assets to return. If the number of found assets exceeds this limit, the result will be truncated. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/$defs/System.Type" + }, + "maxResults": { + "type": "integer" + } + }, + "$defs": { + "System.Type": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)" + } + }, + "$defs": { + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "System.Collections.Generic.List(AIGD.AssetObjectRef)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-find/SKILL.md b/.agent/skills/assets-find/SKILL.md new file mode 100644 index 0000000..33c9580 --- /dev/null +++ b/.agent/skills/assets-find/SKILL.md @@ -0,0 +1,144 @@ +--- +name: assets-find +description: "Search the Unity asset database using a search filter string. The filter accepts names, labels (`l:`), types (`t:`), AssetBundles (`b:`), areas (`a:`), and globs (`glob:`). See the body for the full filter syntax." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Find + +Search the asset database using the search filter string. Allows you to search for Assets. The string argument can provide names, labels or types (classnames). + +## Filter syntax + +- **Name** — filter assets by their filename (without extension). Words separated by whitespace are treated as separate name searches. +- **Labels (`l:`)** — assets can have labels attached. Use `l:` before each label. +- **Types (`t:`)** — find assets based on explicitly identified types. Available types include AnimationClip, AudioClip, AudioMixer, ComputeShader, Font, GUISkin, Material, Mesh, Model, PhysicMaterial, Prefab, Scene, Script, Shader, Sprite, Texture, VideoClip, VisualEffectAsset, VisualEffectSubgraph. +- **AssetBundles (`b:`)** — find assets which are part of an Asset bundle. +- **Area (`a:`)** — find assets in a specific area. Valid values: `all`, `assets`, `packages`. +- **Globbing (`glob:`)** — use globbing to match specific rules. + +Searching is case-insensitive. Use `searchInFolders` to restrict the search scope. `maxResults` caps the returned list (default 10) — results beyond it are truncated. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-find --input '{ + "filter": "string_value", + "searchInFolders": "string_value", + "maxResults": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-find --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-find --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filter` | `string` | No | The filter string can contain search data. Could be empty. Name: Filter assets by their filename (without extension). Words separated by whitespace are treated as separate name searches. Labels (l:): Assets can have labels attached to them. Use 'l:' before each label. Types (t:): Find assets based on explicitly identified types. Use 't:' keyword. Available types: AnimationClip, AudioClip, AudioMixer, ComputeShader, Font, GUISkin, Material, Mesh, Model, PhysicMaterial, Prefab, Scene, Script, Shader, Sprite, Texture, VideoClip, VisualEffectAsset, VisualEffectSubgraph. AssetBundles (b:): Find assets which are part of an Asset bundle. Area (a:): Find assets in a specific area. Valid values are 'all', 'assets', and 'packages'. Globbing (glob:): Use globbing to match specific rules. Note: Searching is case insensitive. | +| `searchInFolders` | `any` | No | The folders where the search will start. If null, the search will be performed in all folders. | +| `maxResults` | `integer` | No | Maximum number of assets to return. If the number of found assets exceeds this limit, the result will be truncated. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filter": { + "type": "string" + }, + "searchInFolders": { + "$ref": "#/$defs/System.String-1" + }, + "maxResults": { + "type": "integer" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)" + } + }, + "$defs": { + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "System.Collections.Generic.List(AIGD.AssetObjectRef)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-get-data/SKILL.md b/.agent/skills/assets-get-data/SKILL.md new file mode 100644 index 0000000..93290bb --- /dev/null +++ b/.agent/skills/assets-get-data/SKILL.md @@ -0,0 +1,200 @@ +--- +name: assets-get-data +description: Get asset data from the asset file in the Unity project — every serializable field and property. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'assets-find' to find the asset first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Get Data + +Get asset data from the asset file in the Unity project. It includes all serializable fields and properties of the asset. Use 'assets-find' tool to find asset before using this tool. + +## Path-scoped reads (token-saving) + +Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. These two parameters are mutually exclusive — supply at most one. When neither is supplied the full asset is serialized (backwards compatible). + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-get-data --input '{ + "assetRef": "string_value", + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View — combines a starting Path, a case-insensitive NamePattern regex, MaxDepth, and an optional TypeFilter. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + }, + "required": [ + "assetRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-material-create/SKILL.md b/.agent/skills/assets-material-create/SKILL.md new file mode 100644 index 0000000..636f567 --- /dev/null +++ b/.agent/skills/assets-material-create/SKILL.md @@ -0,0 +1,127 @@ +--- +name: assets-material-create +description: Create a new Material asset with default parameters at a given 'Assets/'-rooted path ending in '.mat'. Creates intermediate folders if missing. Use 'assets-shader-list-all' to find a valid `shaderName`. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Create Material + +Create new material asset with default parameters. Creates folders recursively if they do not exist. Provide proper 'shaderName' - use 'assets-shader-list-all' tool to find available shaders. + +## Inputs + +- `assetPath` — must start with `Assets/` and end with `.mat`. +- `shaderName` — name resolvable via `UnityEngine.Shader.Find`. + +## Behavior + +Throws if the path is empty, malformed, or the shader cannot be resolved. Creates a default Material from the resolved shader, saves it, refreshes the AssetDatabase, and returns an `AssetObjectRef` pointing at the new asset. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-material-create --input '{ + "assetPath": "string_value", + "shaderName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-material-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-material-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Asset path. Starts with 'Assets/'. Ends with '.mat'. | +| `shaderName` | `string` | Yes | Name of the shader that need to be used to create the material. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "shaderName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "shaderName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-modify/SKILL.md b/.agent/skills/assets-modify/SKILL.md new file mode 100644 index 0000000..d56fd25 --- /dev/null +++ b/.agent/skills/assets-modify/SKILL.md @@ -0,0 +1,215 @@ +--- +name: assets-modify +description: Modify an asset file in the project. Use 'assets-get-data' first to inspect the asset structure before modifying. Not allowed to modify asset files in the 'Packages/' folder — modify them in 'Assets/'. Three modification surfaces are available (content, pathPatches, jsonPatch) — see the skill body for details. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Modify + +## Three modification surfaces + +Use whichever fits the task: + +1. `content` — full `SerializedMember` override (legacy, backwards compatible). +2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`. +3. `jsonPatch` — JSON Merge Patch routed through `Reflector.TryPatch`. + +When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `content`. At least one is required. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-modify --input '{ + "assetRef": "string_value", + "content": "string_value", + "pathPatches": "string_value", + "jsonPatch": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. | +| `content` | `any` | No | Optional. The asset content. It overrides the existing asset content (legacy path). | +| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. | +| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "content": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "pathPatches": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)" + }, + "jsonPatch": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": true + } + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.PathPatch": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required." + }, + "Value": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember." + } + } + }, + "System.Collections.Generic.List(AIGD.PathPatch)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PathPatch" + } + } + }, + "required": [ + "assetRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-move/SKILL.md b/.agent/skills/assets-move/SKILL.md new file mode 100644 index 0000000..638feb0 --- /dev/null +++ b/.agent/skills/assets-move/SKILL.md @@ -0,0 +1,121 @@ +--- +name: assets-move +description: Move or rename assets at the given project paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the assets first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Move + +Move the assets at paths in the project. Should be used for asset rename. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before moving. + +## Inputs + +- `sourcePaths` — paths of the assets to move. +- `destinationPaths` — target paths (must match `sourcePaths` length). + +## Behavior + +Each pair is moved independently via `AssetDatabase.MoveAsset`. Per-pair failures (Unity's `MoveAsset` returns a non-empty error string) are surfaced in `response.Errors`; successful moves accumulate into `response.MovedPaths`. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-move --input '{ + "sourcePaths": "string_value", + "destinationPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-move --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-move --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sourcePaths` | `any` | Yes | The paths of the assets to move. | +| `destinationPaths` | `any` | Yes | The paths of moved assets. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sourcePaths": { + "$ref": "#/$defs/System.String-1" + }, + "destinationPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "sourcePaths", + "destinationPaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.MoveAssetsResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.MoveAssetsResponse": { + "type": "object", + "properties": { + "MovedPaths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of destination paths of successfully moved assets." + }, + "Errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of errors encountered during move operations." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-prefab-close/SKILL.md b/.agent/skills/assets-prefab-close/SKILL.md new file mode 100644 index 0000000..c6f58d5 --- /dev/null +++ b/.agent/skills/assets-prefab-close/SKILL.md @@ -0,0 +1,117 @@ +--- +name: assets-prefab-close +description: Close the currently opened prefab edit stage. Optionally saves changes back to the prefab asset before closing. Pair with 'assets-prefab-open' to enter the edit mode first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Prefab / Close + +Close currently opened prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first. + +## Inputs + +- `save` (default `true`) — when `true`, calls `PrefabUtility.SaveAsPrefabAsset` before exiting the stage; when `false`, the save is skipped. The prefab stage's dirtiness is always cleared at the end, so any unsaved changes are discarded when `save` is `false`. + +## Behavior + +Throws when no prefab stage is currently open. Returns an `AssetObjectRef` for the closed prefab asset. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-prefab-close --input '{ + "save": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-prefab-close --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-prefab-close --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `save` | `boolean` | No | True to save prefab. False to discard changes. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "save": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-prefab-create/SKILL.md b/.agent/skills/assets-prefab-create/SKILL.md new file mode 100644 index 0000000..1b375e5 --- /dev/null +++ b/.agent/skills/assets-prefab-create/SKILL.md @@ -0,0 +1,180 @@ +--- +name: assets-prefab-create +description: Create a Prefab (or Prefab Variant) at a project asset path. Source can be a scene GameObject (`gameObjectRef`) or an existing prefab asset (`sourcePrefabAssetPath`). Creates intermediate folders if missing. Use 'gameobject-find' to locate the source GameObject first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Prefab / Create + +Create a prefab from a GameObject in the current active scene. The prefab will be saved in the project assets at the specified path. Creates folders recursively if they do not exist. If the source GameObject is already a prefab instance and 'connectGameObjectToPrefab' is true, a Prefab Variant is created automatically. To create a Prefab Variant from an existing prefab asset, provide 'sourcePrefabAssetPath' instead of 'gameObjectRef'. Use 'gameobject-find' tool to find the target GameObject first. + +## Inputs (mutually exclusive sources) + +- `prefabAssetPath` — required. Must start with `Assets/` and end with `.prefab`. +- `gameObjectRef` — scene GameObject to convert (or to seed a Prefab Variant from when it is already a prefab instance). +- `sourcePrefabAssetPath` — existing prefab asset to seed a Prefab Variant from. Cannot be combined with `gameObjectRef`. +- `connectGameObjectToPrefab` (default `true`) — when sourcing from a scene GameObject, connect the scene object to the new prefab asset (becoming a prefab instance). Ignored for `sourcePrefabAssetPath` (always creates a variant). + +## Behavior + +Creates intermediate folders along `prefabAssetPath` if they don't already exist. Returns an `AssetObjectRef` pointing at the new prefab asset. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-prefab-create --input '{ + "prefabAssetPath": "string_value", + "gameObjectRef": "string_value", + "sourcePrefabAssetPath": "string_value", + "connectGameObjectToPrefab": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-prefab-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-prefab-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `prefabAssetPath` | `string` | Yes | Prefab asset path. Should be in the format 'Assets/Path/To/Prefab.prefab'. | +| `gameObjectRef` | `any` | No | Reference to a scene GameObject to create the prefab from. If the GameObject is already a prefab instance, a Prefab Variant is created when 'connectGameObjectToPrefab' is true. Optional if 'sourcePrefabAssetPath' is provided. | +| `sourcePrefabAssetPath` | `string` | No | Path to an existing prefab asset to create a Prefab Variant from (e.g. 'Assets/Prefabs/Base.prefab'). When provided, a temporary instance is created, saved as a Prefab Variant, and cleaned up. Optional if 'gameObjectRef' is provided. | +| `connectGameObjectToPrefab` | `boolean` | No | If true, the scene GameObject will be connected to the new prefab (becoming a prefab instance). If the source is already a prefab instance, this creates a Prefab Variant. If false, the prefab asset is created but the scene GameObject remains unchanged. Ignored when 'sourcePrefabAssetPath' is used (always creates a variant). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "prefabAssetPath": { + "type": "string" + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "sourcePrefabAssetPath": { + "type": "string" + }, + "connectGameObjectToPrefab": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "prefabAssetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-prefab-instantiate/SKILL.md b/.agent/skills/assets-prefab-instantiate/SKILL.md new file mode 100644 index 0000000..fc0305e --- /dev/null +++ b/.agent/skills/assets-prefab-instantiate/SKILL.md @@ -0,0 +1,175 @@ +--- +name: assets-prefab-instantiate +description: Instantiate a prefab into the currently active scene at an optional position/rotation/scale, parented under an optional scene GameObject path. Use 'assets-find' to locate the prefab asset first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Prefab / Instantiate + +Instantiates prefab in the current active scene. Use 'assets-find' tool to find prefab assets in the project. + +## Inputs + +- `prefabAssetPath` — project asset path of the prefab to instantiate. +- `gameObjectPath` — destination path in the scene; the last segment becomes the new GameObject's name, any prefix is looked up as the parent (must already exist). +- `position` / `rotation` / `scale` — optional transform; default to zero / zero / one. +- `isLocalSpace` — when `true`, applies the transform in local space relative to the parent. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-prefab-instantiate --input '{ + "prefabAssetPath": "string_value", + "gameObjectPath": "string_value", + "position": "string_value", + "rotation": "string_value", + "scale": "string_value", + "isLocalSpace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-prefab-instantiate --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-prefab-instantiate --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `prefabAssetPath` | `string` | Yes | Prefab asset path. | +| `gameObjectPath` | `string` | Yes | GameObject path in the current active scene. | +| `position` | `any` | No | Transform position of the GameObject. | +| `rotation` | `any` | No | Transform rotation of the GameObject. Euler angles in degrees. | +| `scale` | `any` | No | Transform scale of the GameObject. | +| `isLocalSpace` | `boolean` | No | World or Local space of transform. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "prefabAssetPath": { + "type": "string" + }, + "gameObjectPath": { + "type": "string" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "isLocalSpace": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "prefabAssetPath", + "gameObjectPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-prefab-open/SKILL.md b/.agent/skills/assets-prefab-open/SKILL.md new file mode 100644 index 0000000..3a8784f --- /dev/null +++ b/.agent/skills/assets-prefab-open/SKILL.md @@ -0,0 +1,113 @@ +--- +name: assets-prefab-open +description: Open the prefab edit stage for a prefab instance or prefab asset GameObject. Modifications inside the edit stage propagate to all instances. Pair with 'assets-prefab-close' to exit the stage when done. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Prefab / Open + +Open prefab edit mode for a specific GameObject. In the Edit mode you can modify the prefab. The modification will be applied to all instances of the prefab across the project. Note: Please use 'assets-prefab-close' tool later to exit prefab editing mode. + +## Inputs + +- `gameObjectRef` — reference to a scene prefab instance OR a prefab asset GameObject. The tool resolves the prefab asset path via `PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot` and opens the appropriate prefab stage. + +## Behavior + +Asset-side GameObjects open via the simple `OpenPrefab(path)` overload. Scene-instance GameObjects open via `OpenPrefab(path, gameObject)` so the editor remembers which instance prompted the edit. Editor windows are repainted before returning. Throws when the GameObject cannot be resolved or the stage fails to open. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-prefab-open --input '{ + "gameObjectRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-prefab-open --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-prefab-open --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | GameObject that represents prefab instance of an original prefab GameObject. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/assets-prefab-save/SKILL.md b/.agent/skills/assets-prefab-save/SKILL.md new file mode 100644 index 0000000..65c5264 --- /dev/null +++ b/.agent/skills/assets-prefab-save/SKILL.md @@ -0,0 +1,113 @@ +--- +name: assets-prefab-save +description: Save the currently opened prefab edit stage back to its prefab asset without exiting the stage. Pair with 'assets-prefab-open' to enter the edit mode first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Prefab / Save + +Save a prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first. + +## Behavior + +Calls `PrefabUtility.SaveAsPrefabAsset` on the current prefab stage's contents root, clears the stage's dirtiness flag, repaints editor windows, and returns an `AssetObjectRef` to the saved prefab. Throws when no prefab stage is currently open. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-prefab-save --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-prefab-save --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-prefab-save --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-refresh/SKILL.md b/.agent/skills/assets-refresh/SKILL.md new file mode 100644 index 0000000..578ba28 --- /dev/null +++ b/.agent/skills/assets-refresh/SKILL.md @@ -0,0 +1,82 @@ +--- +name: assets-refresh +description: Refresh the Unity AssetDatabase. Use after files were added or updated outside of the Unity API, or to force script recompilation when a '.cs' file changed. Returns a processing/success response and waits for compilation when triggered. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Refresh + +Refreshes the AssetDatabase. Use it if any file was added or updated in the project outside of Unity API. Use it if need to force scripts recompilation when '.cs' file changed. + +## Inputs + +- `options` — `ImportAssetOptions` flag (default `ForceSynchronousImport`). +- `requestId` — required for processing-mode responses; the tool returns `Processing` immediately and delivers a follow-up completion when compilation finishes. + +## Behavior + +Runs `AssetDatabase.Refresh(options)`. If `EditorApplication.isCompiling` is true after the refresh, schedules a post-compilation notification and returns a `Processing` response. If compilation already failed (`EditorUtility.scriptCompilationFailed`), returns `Success` with the compilation error details. Otherwise returns a plain `Success`. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-refresh --input '{ + "options": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-refresh --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-refresh --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `options` | `any` | No | Asset import options. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "options": { + "$ref": "#/$defs/UnityEditor.ImportAssetOptions" + } + }, + "$defs": { + "UnityEditor.ImportAssetOptions": { + "type": "string", + "enum": [ + "Default", + "ForceUpdate", + "ForceSynchronousImport", + "ImportRecursive", + "DontDownloadFromCacheServer", + "ForceUncompressedImport" + ] + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/assets-shader-get-data/SKILL.md b/.agent/skills/assets-shader-get-data/SKILL.md new file mode 100644 index 0000000..5676c7e --- /dev/null +++ b/.agent/skills/assets-shader-get-data/SKILL.md @@ -0,0 +1,461 @@ +--- +name: assets-shader-get-data +description: "Get detailed data about a shader asset — properties, subshaders, passes, compilation messages, and supported status. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'assets-find' with `t:Shader` or 'assets-shader-list-all' to locate the shader first." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / Shader / Get Data + +Get detailed data about a shader asset in the Unity project. Returns shader properties, subshaders, passes, compilation errors, and supported status. Use 'assets-find' tool with filter 't:Shader' to find shaders, or 'assets-shader-list-all' tool to list all shader names. + +## Toggles (most default off to keep responses small) + +- `includeMessages` (default `true`) — shader compilation messages. +- `includeProperties` (default `false`) — uniforms list. +- `includeSubshaders` (default `false`) — subshader and pass structure. +- `includeSourceCode` (default `false`) — pass source code. Implies `includeSubshaders` and can produce very large responses. + +## Path-scoped reads (token-saving) + +Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. The result populates `View` on the returned `ShaderData`. These two parameters are mutually exclusive. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-shader-get-data --input '{ + "assetRef": "string_value", + "includeMessages": "string_value", + "includeProperties": "string_value", + "includeSubshaders": "string_value", + "includeSourceCode": "string_value", + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-shader-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-shader-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. | +| `includeMessages` | `any` | No | Include compilation error and warning messages. Default: true | +| `includeProperties` | `any` | No | Include shader properties (uniforms) list. Default: false | +| `includeSubshaders` | `any` | No | Include subshader and pass structure. Default: false | +| `includeSourceCode` | `any` | No | Include pass source code in subshader data. Requires 'includeSubshaders' to be true. Can produce very large responses. Default: false | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt against the underlying Shader asset. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View against the underlying Shader asset. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "includeMessages": { + "$ref": "#/$defs/System.Boolean" + }, + "includeProperties": { + "$ref": "#/$defs/System.Boolean" + }, + "includeSubshaders": { + "$ref": "#/$defs/System.Boolean" + }, + "includeSourceCode": { + "$ref": "#/$defs/System.Boolean" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "System.Boolean": { + "type": "boolean" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + }, + "required": [ + "assetRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ShaderData" + } + }, + "$defs": { + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "System.Collections.Generic.List(AIGD.ShaderMessageData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ShaderMessageData" + } + }, + "AIGD.ShaderMessageData": { + "type": "object", + "properties": { + "Message": { + "type": "string", + "description": "The error or warning message text." + }, + "Line": { + "type": "integer", + "description": "The line number in the shader source where the issue occurs." + }, + "Severity": { + "type": "string", + "description": "Severity level (e.g. 'Error', 'Warning')." + }, + "Platform": { + "type": "string", + "description": "The platform on which the error occurs (e.g. 'OpenGLCore', 'D3D11')." + } + }, + "required": [ + "Line" + ] + }, + "System.Collections.Generic.List(AIGD.ShaderPropertyData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ShaderPropertyData" + } + }, + "AIGD.ShaderPropertyData": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Property name as used in shader code (e.g. '_MainTex', '_Color')." + }, + "Description": { + "type": "string", + "description": "Human-readable description/display name of the property." + }, + "Type": { + "type": "string", + "description": "Property type (e.g. 'Color', 'Float', 'Range', 'Texture', 'Vector', 'Int')." + }, + "Flags": { + "type": "string", + "description": "Property flags (e.g. 'None', 'HideInInspector', 'PerRendererData')." + }, + "NameId": { + "type": "integer", + "description": "The unique name ID for this property." + }, + "RangeMin": { + "type": "number", + "description": "Minimum value for Range properties. Null for non-range properties." + }, + "RangeMax": { + "type": "number", + "description": "Maximum value for Range properties. Null for non-range properties." + }, + "DefaultTextureName": { + "type": "string", + "description": "Default texture name for Texture properties. Null if not applicable." + }, + "Attributes": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "Custom attributes applied to this property. Null if none." + } + }, + "required": [ + "NameId" + ] + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "System.Collections.Generic.List(AIGD.SubshaderData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.SubshaderData" + } + }, + "AIGD.SubshaderData": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "description": "Index of this subshader within the shader." + }, + "PassCount": { + "type": "integer", + "description": "Number of passes in this subshader." + }, + "Passes": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PassData)", + "description": "List of passes in this subshader. Null if no passes." + } + }, + "required": [ + "Index", + "PassCount" + ] + }, + "System.Collections.Generic.List(AIGD.PassData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PassData" + } + }, + "AIGD.PassData": { + "type": "object", + "properties": { + "Index": { + "type": "integer", + "description": "Index of this pass within the subshader." + }, + "Name": { + "type": "string", + "description": "Name of the pass. Null if unnamed." + }, + "SourceCode": { + "type": "string", + "description": "Source code of the pass. Null if unavailable." + } + }, + "required": [ + "Index" + ] + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "AIGD.ShaderData": { + "type": "object", + "properties": { + "Reference": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to the shader asset for future operations." + }, + "Name": { + "type": "string", + "description": "Full name of the shader (e.g. 'Standard', 'Universal Render Pipeline/Lit')." + }, + "IsSupported": { + "type": "boolean", + "description": "Whether the shader is supported on the current GPU and platform." + }, + "RenderQueue": { + "type": "integer", + "description": "The render queue value of the shader." + }, + "HasErrors": { + "type": "boolean", + "description": "Whether the shader has any compilation errors." + }, + "PropertyCount": { + "type": "integer", + "description": "Number of properties exposed by the shader." + }, + "PassCount": { + "type": "integer", + "description": "Total number of passes in the shader." + }, + "RenderType": { + "type": "string", + "description": "The RenderType tag value from the first pass, if set." + }, + "Messages": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.ShaderMessageData)", + "description": "Compilation messages including errors and warnings. Null if no messages." + }, + "Properties": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.ShaderPropertyData)", + "description": "List of shader properties (uniforms). Null if the shader has no properties." + }, + "Subshaders": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.SubshaderData)", + "description": "List of subshaders with their passes. Null if shader data is unavailable." + }, + "View": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' is supplied. Null otherwise." + } + }, + "required": [ + "IsSupported", + "RenderQueue", + "HasErrors", + "PropertyCount", + "PassCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/assets-shader-list-all/SKILL.md b/.agent/skills/assets-shader-list-all/SKILL.md new file mode 100644 index 0000000..cf9be2c --- /dev/null +++ b/.agent/skills/assets-shader-list-all/SKILL.md @@ -0,0 +1,86 @@ +--- +name: assets-shader-list-all +description: List all shaders available in the project assets and packages, sorted by name. Use this to discover a valid `shaderName` for 'assets-material-create'. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Assets / List Shaders + +List all available shaders in the project assets and packages. Returns their names. Use this to find a shader name for 'assets-material-create' tool. + +## Behavior + +Enumerates shaders via `ShaderUtils.GetAllShaders`, filters out nulls, and returns the names alphabetically sorted. + +## How to Call + +```bash +unity-mcp-cli run-tool assets-shader-list-all --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool assets-shader-list-all --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool assets-shader-list-all --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-add-extension/SKILL.md b/.agent/skills/cinemachine-add-extension/SKILL.md new file mode 100644 index 0000000..c2afb79 --- /dev/null +++ b/.agent/skills/cinemachine-add-extension/SKILL.md @@ -0,0 +1,226 @@ +--- +name: cinemachine-add-extension +description: Add a `CinemachineExtension`-derived component (e.g. `CinemachineDeoccluder`, `CinemachineConfiner3D`, `CinemachineFollowZoom`, `CinemachineRecomposer`) to a `CinemachineCamera` GameObject, resolved by type name. The type is validated to derive from `CinemachineExtension`. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Add Extension + +Add a Cinemachine extension component to a `CinemachineCamera` GameObject. Extensions augment the camera pipeline (collision avoidance, framing, post-processing, etc.). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `extensionTypeName` — the extension type name. A full name like `Unity.Cinemachine.CinemachineDeoccluder` is preferred; a bare class name like `CinemachineDeoccluder` is also resolved against the `Unity.Cinemachine` namespace as a fallback. + +## Behavior + +Resolves the type, verifies it derives from `Unity.Cinemachine.CinemachineExtension`, adds it to the GameObject, marks the scene dirty, and repaints. Throws if the type cannot be resolved or is not an extension. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-add-extension --input '{ + "gameObjectRef": "string_value", + "extensionTypeName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-add-extension --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-add-extension --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `extensionTypeName` | `string` | Yes | Extension type name, e.g. 'Unity.Cinemachine.CinemachineDeoccluder' or 'CinemachineDeoccluder'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "extensionTypeName": { + "type": "string" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "extensionTypeName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-AddExtensionResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-AddExtensionResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "extensionRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the added extension component." + }, + "extensionTypeName": { + "type": "string", + "description": "Full type name of the added extension." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-brain-ensure/SKILL.md b/.agent/skills/cinemachine-brain-ensure/SKILL.md new file mode 100644 index 0000000..8ddac34 --- /dev/null +++ b/.agent/skills/cinemachine-brain-ensure/SKILL.md @@ -0,0 +1,221 @@ +--- +name: cinemachine-brain-ensure +description: Ensure a `CinemachineBrain` exists on a `Camera`. Targets the referenced Camera GameObject, or `Camera.main` when none is given. Returns the brain + camera info. A CinemachineBrain is required for any CinemachineCamera to actually drive the rendering Camera. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Ensure Brain + +Ensure a `CinemachineBrain` component exists on a `Camera`. A CinemachineBrain is the bridge between Cinemachine virtual cameras and a real Unity `Camera`; without it, `CinemachineCamera` components have no effect on the rendered view. + +## Inputs + +- `cameraRef` — optional GameObject hosting a `Camera`. When omitted, `Camera.main` (a Camera tagged `MainCamera`) is used. + +## Behavior + +Resolves the Camera, adds a `CinemachineBrain` if one is missing (idempotent — an existing brain is reused), marks the scene dirty, repaints the Editor, and returns the brain instanceId plus the camera name. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-brain-ensure --input '{ + "cameraRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-brain-ensure --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-brain-ensure --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `cameraRef` | `any` | No | Optional reference to the GameObject hosting the Camera. If omitted, Camera.main is used. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "cameraRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-BrainEnsureResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-BrainEnsureResponse": { + "type": "object", + "properties": { + "cameraRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Camera GameObject hosting the CinemachineBrain." + }, + "brainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineBrain component." + }, + "cameraName": { + "type": "string", + "description": "Name of the Camera GameObject." + }, + "created": { + "type": "boolean", + "description": "True if a new CinemachineBrain was created; false if one already existed." + }, + "defaultBlendStyle": { + "type": "string", + "description": "The current default blend style of the brain." + }, + "defaultBlendTime": { + "type": "number", + "description": "The current default blend time (seconds) of the brain." + } + }, + "required": [ + "created", + "defaultBlendTime" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-camera-create/SKILL.md b/.agent/skills/cinemachine-camera-create/SKILL.md new file mode 100644 index 0000000..ea5a162 --- /dev/null +++ b/.agent/skills/cinemachine-camera-create/SKILL.md @@ -0,0 +1,275 @@ +--- +name: cinemachine-camera-create +description: Create a new GameObject with a `CinemachineCamera` (Cinemachine 3.x virtual camera) in the active scene. Optionally set name, position, rotation, priority, and Follow / LookAt targets. Returns the new GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Create Camera + +Create a new GameObject hosting a `CinemachineCamera` component in the active scene. The `CinemachineCamera` is the Cinemachine 3.x virtual camera that a `CinemachineBrain` blends between to drive the real Unity Camera. + +## Inputs + +- `name` — optional GameObject name (default `CinemachineCamera`). +- `position` — optional world `Vector3` position (default zero). +- `rotation` — optional euler-degrees `Vector3` rotation (default zero). +- `priority` — optional priority value; higher wins when multiple cameras compete (default 0). +- `followRef` — optional GameObject the camera should Follow (position target). +- `lookAtRef` — optional GameObject the camera should LookAt (aim target). + +## Behavior + +Creates the GameObject, adds a `CinemachineCamera`, sets transform / `Priority.Value` / `Follow` / `LookAt`, marks the scene dirty, repaints the Editor, and returns the new GameObject reference and instanceId. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-camera-create --input '{ + "name": "string_value", + "position": "string_value", + "rotation": "string_value", + "priority": 0, + "followRef": "string_value", + "lookAtRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | Name of the new CinemachineCamera GameObject. | +| `position` | `any` | No | World-space position of the camera. | +| `rotation` | `any` | No | World-space rotation of the camera in euler angles (degrees). | +| `priority` | `integer` | No | Priority value. Higher priority wins when several CinemachineCameras are active. | +| `followRef` | `any` | No | Optional GameObject the camera should Follow (drives position). | +| `lookAtRef` | `any` | No | Optional GameObject the camera should LookAt (drives aim). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "priority": { + "type": "integer" + }, + "followRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "lookAtRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraCreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraCreateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created CinemachineCamera component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created GameObject." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the created GameObject." + }, + "priority": { + "type": "integer", + "description": "Resolved priority value." + }, + "follow": { + "type": "string", + "description": "Name of the Follow target, or null." + }, + "lookAt": { + "type": "string", + "description": "Name of the LookAt target, or null." + } + }, + "required": [ + "instanceId", + "priority" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-camera-get/SKILL.md b/.agent/skills/cinemachine-camera-get/SKILL.md new file mode 100644 index 0000000..63e963d --- /dev/null +++ b/.agent/skills/cinemachine-camera-get/SKILL.md @@ -0,0 +1,285 @@ +--- +name: cinemachine-camera-get +description: Inspect a `CinemachineCamera` — its lens, Follow / LookAt targets, priority, and the list of pipeline components (Body / Aim / Noise / extensions) currently attached. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Get Camera + +Inspect a `CinemachineCamera` component in the active scene. Returns the priority, the Follow and LookAt target names, the serialized `LensSettings`, and the list of pipeline / extension components attached to the camera GameObject. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `deepSerialization` — when `true`, the lens is serialized recursively through nested objects; otherwise only top-level members are serialized. + +## Behavior + +Serializes `CinemachineCamera.Lens` via ReflectorNet and enumerates every `CinemachineComponentBase` and `CinemachineExtension` on the GameObject by type name. Read-only — nothing is mutated. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-camera-get --input '{ + "gameObjectRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `deepSerialization` | `boolean` | No | Performs deep serialization of the lens including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "priority": { + "type": "integer", + "description": "Priority value of the camera." + }, + "follow": { + "type": "string", + "description": "Name of the Follow target, or null." + }, + "lookAt": { + "type": "string", + "description": "Name of the LookAt target, or null." + }, + "lens": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized LensSettings of the camera." + }, + "pipelineComponents": { + "$ref": "#/$defs/System.String-1", + "description": "Type names of the CinemachineComponentBase pipeline components (Body/Aim/Noise) attached." + }, + "extensions": { + "$ref": "#/$defs/System.String-1", + "description": "Type names of the CinemachineExtension components attached." + } + }, + "required": [ + "priority" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-camera-list/SKILL.md b/.agent/skills/cinemachine-camera-list/SKILL.md new file mode 100644 index 0000000..582db89 --- /dev/null +++ b/.agent/skills/cinemachine-camera-list/SKILL.md @@ -0,0 +1,197 @@ +--- +name: cinemachine-camera-list +description: List every `CinemachineCamera` in the active scene with its name, priority, and whether it is currently the live (active) camera according to an active `CinemachineBrain`. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / List Cameras + +List every `CinemachineCamera` in the active scene. For each, returns the name, the priority value, a reference, and whether the camera is currently live (driving the view through an active `CinemachineBrain`). + +## Inputs + +- `includeInactive` (bool, default true) — include inactive/disabled CinemachineCameras. + +## Behavior + +Finds all `CinemachineCamera` instances (including inactive ones), reads each `Priority.Value`, and compares against `CinemachineBrain.ActiveVirtualCamera` across all active brains to compute `isLive`. Read-only. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-camera-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-camera-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include inactive/disabled CinemachineCameras; if false, only those on active GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "name": { + "type": "string", + "description": "Name of the camera GameObject." + }, + "priority": { + "type": "integer", + "description": "Priority value of the camera." + }, + "isLive": { + "type": "boolean", + "description": "Whether this camera is currently live (active through a CinemachineBrain)." + } + }, + "required": [ + "priority", + "isLive" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of CinemachineCameras found." + }, + "cameras": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CameraListItem-1", + "description": "The CinemachineCameras in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-get/SKILL.md b/.agent/skills/cinemachine-get/SKILL.md new file mode 100644 index 0000000..ff095ea --- /dev/null +++ b/.agent/skills/cinemachine-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: cinemachine-get +description: "Generic read: serialize any Cinemachine `Component` (a type in the `Unity.Cinemachine` namespace) on a GameObject via ReflectorNet. Pair with 'cinemachine-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Get Component + +Serialize any Cinemachine component on a GameObject using ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools (e.g. a specific extension's settings). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Cinemachine component; otherwise the first component whose type lives in the `Unity.Cinemachine` namespace is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target Cinemachine component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Cinemachine component. | +| `componentRef` | `any` | No | Optional reference to a specific Cinemachine component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CinemachineGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CinemachineGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-modify/SKILL.md b/.agent/skills/cinemachine-modify/SKILL.md new file mode 100644 index 0000000..bc53b12 --- /dev/null +++ b/.agent/skills/cinemachine-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: cinemachine-modify +description: "Generic write: apply a `SerializedMember` diff to any Cinemachine `Component` on a GameObject via ReflectorNet `TryModify`. Use 'cinemachine-get' first to inspect the structure so the diff is targeted." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Modify Component + +Modify any Cinemachine component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Cinemachine component; otherwise the first component in the `Unity.Cinemachine` namespace is used. +- `data` — the `SerializedMember` diff to apply. Include only the properties you want to change. + +## Behavior + +Finds the target Cinemachine component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Cinemachine component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include properties you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific Cinemachine component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CinemachineModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-CinemachineModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-aim/SKILL.md b/.agent/skills/cinemachine-set-aim/SKILL.md new file mode 100644 index 0000000..211e5b9 --- /dev/null +++ b/.agent/skills/cinemachine-set-aim/SKILL.md @@ -0,0 +1,252 @@ +--- +name: cinemachine-set-aim +description: Add or replace the rotation-control (Aim) component of a `CinemachineCamera`, chosen by `AimType` (RotationComposer, HardLookAt, PanTilt, or None). Applies common params (screen X/Y, damping) to RotationComposer where applicable. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Aim + +Add or replace the Aim (rotation-control) component of a `CinemachineCamera`. Any existing Aim component is removed first, then the chosen one is added — so this is destructive to the previous Aim component. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `aimType` — `AimType` enum: `RotationComposer`, `HardLookAt`, `PanTilt`, or `None` (removes the Aim component). +- `screenX`, `screenY` — optional normalized on-screen target position for `RotationComposer` (`Composition.ScreenPosition`). Typically in the range -0.5..0.5 (0,0 = center). +- `damping` — optional uniform damping value (applies to `RotationComposer.Damping`). + +## Behavior + +Removes every existing `CinemachineRotationComposer`, `CinemachineHardLookAt`, and `CinemachinePanTilt` on the GameObject, then adds the requested one and applies the optional params. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-aim --input '{ + "gameObjectRef": "string_value", + "aimType": "string_value", + "screenX": "string_value", + "screenY": "string_value", + "damping": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-aim --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-aim --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `aimType` | `string` | Yes | Which rotation-control (Aim) component to use. | +| `screenX` | `any` | No | Normalized on-screen X target position for RotationComposer (Composition.ScreenPosition.x). | +| `screenY` | `any` | No | Normalized on-screen Y target position for RotationComposer (Composition.ScreenPosition.y). | +| `damping` | `any` | No | Uniform damping value applied where the component supports damping (RotationComposer). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "aimType": { + "type": "string", + "enum": [ + "None", + "RotationComposer", + "HardLookAt", + "PanTilt" + ] + }, + "screenX": { + "$ref": "#/$defs/System.Single" + }, + "screenY": { + "$ref": "#/$defs/System.Single" + }, + "damping": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef", + "aimType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetAimResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetAimResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "aimType": { + "type": "string", + "description": "The AimType that was applied." + }, + "componentName": { + "type": "string", + "description": "The Cinemachine component type name that was added (or 'None')." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-body/SKILL.md b/.agent/skills/cinemachine-set-body/SKILL.md new file mode 100644 index 0000000..8219d8a --- /dev/null +++ b/.agent/skills/cinemachine-set-body/SKILL.md @@ -0,0 +1,275 @@ +--- +name: cinemachine-set-body +description: Add or replace the position-control (Body) component of a `CinemachineCamera`, chosen by `BodyType` (Follow, OrbitalFollow, ThirdPersonFollow, PositionComposer, HardLockToTarget, or None). Applies common params (followOffset, damping, cameraDistance) where applicable. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Body + +Add or replace the Body (position-control) component of a `CinemachineCamera`. Any existing Body component is removed first, then the chosen one is added — so this is destructive to the previous Body component. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `bodyType` — `BodyType` enum: `Follow`, `OrbitalFollow`, `ThirdPersonFollow`, `PositionComposer`, `HardLockToTarget`, or `None` (removes the Body component). +- `followOffset` — optional `Vector3` offset from the Follow target (applies to `Follow`). +- `damping` — optional uniform damping value (applied where the component supports damping). +- `cameraDistance` — optional distance from the target (applies to `ThirdPersonFollow` / `PositionComposer` / `OrbitalFollow` radius). + +## Behavior + +Removes every existing `CinemachineFollow`, `CinemachineOrbitalFollow`, `CinemachineThirdPersonFollow`, `CinemachinePositionComposer`, and `CinemachineHardLockToTarget` on the GameObject, then adds the requested one and applies the optional params. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-body --input '{ + "gameObjectRef": "string_value", + "bodyType": "string_value", + "followOffset": "string_value", + "damping": "string_value", + "cameraDistance": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-body --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-body --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `bodyType` | `string` | Yes | Which position-control (Body) component to use. | +| `followOffset` | `any` | No | Offset from the Follow target (applies to Follow). | +| `damping` | `any` | No | Uniform damping value applied where the component supports damping. | +| `cameraDistance` | `any` | No | Distance from the target (ThirdPersonFollow/PositionComposer/OrbitalFollow radius). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "bodyType": { + "type": "string", + "enum": [ + "None", + "Follow", + "OrbitalFollow", + "ThirdPersonFollow", + "PositionComposer", + "HardLockToTarget" + ] + }, + "followOffset": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "damping": { + "$ref": "#/$defs/System.Single" + }, + "cameraDistance": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef", + "bodyType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetBodyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetBodyResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "bodyType": { + "type": "string", + "description": "The BodyType that was applied." + }, + "componentName": { + "type": "string", + "description": "The Cinemachine component type name that was added (or 'None')." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-default-blend/SKILL.md b/.agent/skills/cinemachine-set-default-blend/SKILL.md new file mode 100644 index 0000000..b8979ed --- /dev/null +++ b/.agent/skills/cinemachine-set-default-blend/SKILL.md @@ -0,0 +1,242 @@ +--- +name: cinemachine-set-default-blend +description: Set the `DefaultBlend` of a `CinemachineBrain` — the blend style (Cut, EaseInOut, Linear, etc.) and duration used when transitioning between CinemachineCameras. Targets the referenced Camera's brain, or `Camera.main`'s brain. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Default Blend + +Set the default blend on a `CinemachineBrain`. The default blend is used whenever the brain transitions from one live CinemachineCamera to another and no custom blend overrides it. + +## Inputs + +- `cameraRef` — optional GameObject hosting the Camera + `CinemachineBrain`. When omitted, `Camera.main` is used. +- `style` — `CinemachineBlendDefinition.Styles` enum (`Cut`, `EaseInOut`, `EaseIn`, `EaseOut`, `HardIn`, `HardOut`, `Linear`, `Custom`). +- `time` — blend duration in seconds. + +## Behavior + +Resolves the brain (throws if the Camera has none), assigns a new `CinemachineBlendDefinition(style, time)` to `DefaultBlend`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-default-blend --input '{ + "style": "string_value", + "time": 0, + "cameraRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-default-blend --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-default-blend --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `style` | `string` | Yes | Blend style used when transitioning between CinemachineCameras. | +| `time` | `number` | No | Blend duration in seconds. | +| `cameraRef` | `any` | No | Optional reference to the GameObject hosting the Camera + CinemachineBrain. If omitted, Camera.main is used. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "style": { + "type": "string", + "enum": [ + "Cut", + "EaseInOut", + "EaseIn", + "EaseOut", + "HardIn", + "HardOut", + "Linear", + "Custom" + ] + }, + "time": { + "type": "number" + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "style" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetDefaultBlendResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetDefaultBlendResponse": { + "type": "object", + "properties": { + "cameraRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Camera GameObject hosting the CinemachineBrain." + }, + "brainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineBrain component." + }, + "style": { + "type": "string", + "description": "Resulting blend style." + }, + "time": { + "type": "number", + "description": "Resulting blend time (seconds)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "time", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-lens/SKILL.md b/.agent/skills/cinemachine-set-lens/SKILL.md new file mode 100644 index 0000000..8fee2a9 --- /dev/null +++ b/.agent/skills/cinemachine-set-lens/SKILL.md @@ -0,0 +1,268 @@ +--- +name: cinemachine-set-lens +description: Set lens fields of a `CinemachineCamera`'s `LensSettings` — field of view (perspective) or orthographic size, near / far clip planes, and Dutch (roll) angle. Only the fields you pass are changed. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Lens + +Set lens fields on a `CinemachineCamera`. The `LensSettings` controls how the resulting Unity Camera is configured while this virtual camera is live. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `fieldOfView` — optional vertical FOV in degrees (perspective cameras). +- `orthographicSize` — optional orthographic half-height (orthographic cameras). +- `nearClipPlane`, `farClipPlane` — optional clip plane distances. +- `dutch` — optional Dutch (roll) angle in degrees. + +## Behavior + +Reads the current `LensSettings`, applies only the provided fields, writes it back, marks the scene dirty, and repaints the Editor. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-lens --input '{ + "gameObjectRef": "string_value", + "fieldOfView": "string_value", + "orthographicSize": "string_value", + "nearClipPlane": "string_value", + "farClipPlane": "string_value", + "dutch": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-lens --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-lens --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `fieldOfView` | `any` | No | Vertical field of view in degrees (perspective). | +| `orthographicSize` | `any` | No | Orthographic size (half-height) for orthographic cameras. | +| `nearClipPlane` | `any` | No | Near clip plane distance. | +| `farClipPlane` | `any` | No | Far clip plane distance. | +| `dutch` | `any` | No | Dutch (roll) angle in degrees. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "fieldOfView": { + "$ref": "#/$defs/System.Single" + }, + "orthographicSize": { + "$ref": "#/$defs/System.Single" + }, + "nearClipPlane": { + "$ref": "#/$defs/System.Single" + }, + "farClipPlane": { + "$ref": "#/$defs/System.Single" + }, + "dutch": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetLensResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetLensResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "fieldOfView": { + "type": "number", + "description": "Resulting field of view." + }, + "orthographicSize": { + "type": "number", + "description": "Resulting orthographic size." + }, + "nearClipPlane": { + "type": "number", + "description": "Resulting near clip plane." + }, + "farClipPlane": { + "type": "number", + "description": "Resulting far clip plane." + }, + "dutch": { + "type": "number", + "description": "Resulting Dutch (roll) angle." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "fieldOfView", + "orthographicSize", + "nearClipPlane", + "farClipPlane", + "dutch", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-noise/SKILL.md b/.agent/skills/cinemachine-set-noise/SKILL.md new file mode 100644 index 0000000..d6793ef --- /dev/null +++ b/.agent/skills/cinemachine-set-noise/SKILL.md @@ -0,0 +1,241 @@ +--- +name: cinemachine-set-noise +description: Add or configure a `CinemachineBasicMultiChannelPerlin` (procedural camera shake / handheld noise) on a `CinemachineCamera`. Sets `AmplitudeGain` and `FrequencyGain`. The noise profile asset is optional and left untouched when not supplied. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Noise + +Add or configure a `CinemachineBasicMultiChannelPerlin` noise component on a `CinemachineCamera`. This drives procedural Perlin-noise shake (handheld camera feel). The actual noise shape comes from a `NoiseSettings` profile asset; without one, the amplitude/frequency gains have no visible effect, so this tool is null-safe and does not require a profile. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `amplitudeGain` — optional gain applied to the profile amplitudes (1 = normal). +- `frequencyGain` — optional gain applied to the profile frequencies (1 = normal). + +## Behavior + +Reuses an existing `CinemachineBasicMultiChannelPerlin` on the GameObject or adds one, then applies the provided gains. The noise profile asset is never modified here (leave it null-safe). Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-noise --input '{ + "gameObjectRef": "string_value", + "amplitudeGain": "string_value", + "frequencyGain": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-noise --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-noise --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `amplitudeGain` | `any` | No | Gain applied to the noise profile amplitudes (1 = normal). | +| `frequencyGain` | `any` | No | Gain applied to the noise profile frequencies (1 = normal). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "amplitudeGain": { + "$ref": "#/$defs/System.Single" + }, + "frequencyGain": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetNoiseResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetNoiseResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "amplitudeGain": { + "type": "number", + "description": "Resulting amplitude gain." + }, + "frequencyGain": { + "type": "number", + "description": "Resulting frequency gain." + }, + "hasNoiseProfile": { + "type": "boolean", + "description": "Whether a NoiseSettings profile asset is assigned." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "amplitudeGain", + "frequencyGain", + "hasNoiseProfile", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-priority/SKILL.md b/.agent/skills/cinemachine-set-priority/SKILL.md new file mode 100644 index 0000000..03fa572 --- /dev/null +++ b/.agent/skills/cinemachine-set-priority/SKILL.md @@ -0,0 +1,223 @@ +--- +name: cinemachine-set-priority +description: Set the `Priority.Value` of a `CinemachineCamera`. The highest-priority active camera wins control of the `CinemachineBrain`. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Priority + +Set the priority of a `CinemachineCamera`. When multiple CinemachineCameras are active, the one with the highest priority becomes live (drives the rendered view through the `CinemachineBrain`). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `priority` — the new integer priority value. + +## Behavior + +Assigns `CinemachineCamera.Priority` with the given value, marks the scene dirty, and repaints the Editor. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-priority --input '{ + "gameObjectRef": "string_value", + "priority": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-priority --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-priority --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `priority` | `integer` | Yes | The new priority value. Higher wins when multiple cameras are active. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "priority": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "priority" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetPriorityResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetPriorityResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "priority": { + "type": "integer", + "description": "Resulting priority value." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "priority", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/cinemachine-set-targets/SKILL.md b/.agent/skills/cinemachine-set-targets/SKILL.md new file mode 100644 index 0000000..4141f57 --- /dev/null +++ b/.agent/skills/cinemachine-set-targets/SKILL.md @@ -0,0 +1,243 @@ +--- +name: cinemachine-set-targets +description: Set the `Follow` (position) and/or `LookAt` (aim) targets of a `CinemachineCamera`. Pass `clearFollow` / `clearLookAt` to explicitly remove a target instead of setting one. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Cinemachine / Set Targets + +Set the `Follow` and/or `LookAt` targets of a `CinemachineCamera`. The Follow target drives the position-control (Body) component; the LookAt target drives the rotation-control (Aim) component. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `CinemachineCamera` (required). +- `followRef` — optional GameObject to set as the Follow target. +- `lookAtRef` — optional GameObject to set as the LookAt target. +- `clearFollow` — when `true`, sets Follow to null (ignored if `followRef` is provided). +- `clearLookAt` — when `true`, sets LookAt to null (ignored if `lookAtRef` is provided). + +## Behavior + +Only the targets you specify are changed; omitted targets are left untouched unless the matching `clear*` flag is set. Marks the scene dirty and repaints the Editor. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool cinemachine-set-targets --input '{ + "gameObjectRef": "string_value", + "followRef": "string_value", + "lookAtRef": "string_value", + "clearFollow": false, + "clearLookAt": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool cinemachine-set-targets --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool cinemachine-set-targets --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the CinemachineCamera component. | +| `followRef` | `any` | No | Optional GameObject to set as the Follow (position) target. | +| `lookAtRef` | `any` | No | Optional GameObject to set as the LookAt (aim) target. | +| `clearFollow` | `boolean` | No | If true, clears the Follow target (ignored when followRef is provided). | +| `clearLookAt` | `boolean` | No | If true, clears the LookAt target (ignored when lookAtRef is provided). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "followRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "lookAtRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clearFollow": { + "type": "boolean" + }, + "clearLookAt": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetTargetsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Cinemachine-SetTargetsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the CinemachineCamera GameObject." + }, + "cameraRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the CinemachineCamera component." + }, + "follow": { + "type": "string", + "description": "Name of the resulting Follow target, or null." + }, + "lookAt": { + "type": "string", + "description": "Name of the resulting LookAt target, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/console-clear-logs/SKILL.md b/.agent/skills/console-clear-logs/SKILL.md new file mode 100644 index 0000000..d1c7a1b --- /dev/null +++ b/.agent/skills/console-clear-logs/SKILL.md @@ -0,0 +1,64 @@ +--- +name: console-clear-logs +description: Clear the MCP log cache (used by 'console-get-logs') and the Unity Editor Console window. Useful for isolating logs to a specific action by clearing the slate first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Console / Clear Logs + +Clears the MCP log cache (used by console-get-logs) and the Unity Editor Console window. Useful for isolating errors related to a specific action by clearing logs before performing the action. + +## Behavior + +Calls `Debug.ClearDeveloperConsole()` to wipe the Editor Console, then clears the MCP-side `LogCollector` cache so subsequent 'console-get-logs' calls only see new entries. + +## How to Call + +```bash +unity-mcp-cli run-tool console-clear-logs --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool console-clear-logs --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool console-clear-logs --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/console-get-logs/SKILL.md b/.agent/skills/console-get-logs/SKILL.md new file mode 100644 index 0000000..6f4ce02 --- /dev/null +++ b/.agent/skills/console-get-logs/SKILL.md @@ -0,0 +1,145 @@ +--- +name: console-get-logs +description: Retrieve Unity Editor logs from the MCP plugin's `LogCollector`, optionally filtered by log type or time window. Useful for debugging and monitoring Editor activity. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Console / Get Logs + +Retrieves Unity Editor logs. Useful for debugging and monitoring Unity Editor activity. + +## Inputs + +- `maxEntries` (default 100, minimum 1) — caps the size of the returned array. +- `logTypeFilter` — Unity `LogType` filter; `null` returns all severities. +- `includeStackTrace` (default `false`) — include stack-trace strings in each entry. +- `lastMinutes` (default 0) — when non-zero, only logs from the last N minutes are returned. + +## How to Call + +```bash +unity-mcp-cli run-tool console-get-logs --input '{ + "maxEntries": 0, + "logTypeFilter": "string_value", + "includeStackTrace": false, + "lastMinutes": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool console-get-logs --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool console-get-logs --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `maxEntries` | `integer` | No | Maximum number of log entries to return. Minimum: 1. Default: 100 | +| `logTypeFilter` | `any` | No | Filter by log type. 'null' means All. | +| `includeStackTrace` | `boolean` | No | Include stack traces in the output. Default: false | +| `lastMinutes` | `integer` | No | Return logs from the last N minutes. If 0, returns all available logs. Default: 0 | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "maxEntries": { + "type": "integer" + }, + "logTypeFilter": { + "$ref": "#/$defs/UnityEngine.LogType" + }, + "includeStackTrace": { + "type": "boolean" + }, + "lastMinutes": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.LogType": { + "type": "string", + "enum": [ + "Error", + "Assert", + "Warning", + "Log", + "Exception" + ] + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.LogEntry-1" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.LogEntry": { + "type": "object", + "properties": { + "LogType": { + "type": "string", + "enum": [ + "Error", + "Assert", + "Warning", + "Log", + "Exception" + ] + }, + "Message": { + "type": "string" + }, + "Timestamp": { + "type": "string", + "format": "date-time" + }, + "StackTrace": { + "type": "string" + } + }, + "required": [ + "LogType", + "Timestamp" + ] + }, + "com.IvanMurzak.Unity.MCP.LogEntry-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.LogEntry" + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/editor-application-get-state/SKILL.md b/.agent/skills/editor-application-get-state/SKILL.md new file mode 100644 index 0000000..5346155 --- /dev/null +++ b/.agent/skills/editor-application-get-state/SKILL.md @@ -0,0 +1,127 @@ +--- +name: editor-application-get-state +description: Return the current state of `UnityEditor.EditorApplication` — playmode, paused state, compilation state, and related flags. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Editor / Application / Get State + +Returns available information about 'UnityEditor.EditorApplication'. Use it to get information about the current state of the Unity Editor application. Such as: playmode, paused state, compilation state, etc. + +## Behavior + +Snapshots Editor state via `EditorStatsData.FromEditor()` on the main thread and returns the result. + +## How to Call + +```bash +unity-mcp-cli run-tool editor-application-get-state --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool editor-application-get-state --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool editor-application-get-state --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.EditorStatsData", + "description": "Available information about 'UnityEditor.EditorApplication'." + } + }, + "$defs": { + "AIGD.EditorStatsData": { + "type": "object", + "properties": { + "IsPlaying": { + "type": "boolean", + "description": "Whether the Editor is in Play mode." + }, + "IsPaused": { + "type": "boolean", + "description": "Whether the Editor is paused." + }, + "IsCompiling": { + "type": "boolean", + "description": "Is editor currently compiling scripts? (Read Only)" + }, + "IsPlayingOrWillChangePlaymode": { + "type": "boolean", + "description": "Editor application state which is true only when the Editor is currently in or about to enter Play mode. (Read Only)" + }, + "IsUpdating": { + "type": "boolean", + "description": "True if the Editor is currently refreshing the AssetDatabase. (Read Only)" + }, + "ApplicationContentsPath": { + "type": "string", + "description": "Path to the Unity editor contents folder. (Read Only)" + }, + "ApplicationPath": { + "type": "string", + "description": "Gets the path to the Unity Editor application. (Read Only)" + }, + "TimeSinceStartup": { + "type": "number", + "description": "The time since the editor was started. (Read Only)" + } + }, + "required": [ + "IsPlaying", + "IsPaused", + "IsCompiling", + "IsPlayingOrWillChangePlaymode", + "IsUpdating", + "TimeSinceStartup" + ], + "description": "Available information about 'UnityEditor.EditorApplication'." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/editor-application-set-state/SKILL.md b/.agent/skills/editor-application-set-state/SKILL.md new file mode 100644 index 0000000..77430f5 --- /dev/null +++ b/.agent/skills/editor-application-set-state/SKILL.md @@ -0,0 +1,137 @@ +--- +name: editor-application-set-state +description: Start / stop / pause the Unity Editor 'playmode'. Use 'editor-application-get-state' to inspect the current state first. Throws if the project currently has compilation errors. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Editor / Application / Set State + +Control the Unity Editor application state. You can start, stop, or pause the 'playmode'. Use 'editor-application-get-state' tool to get the current state first. + +## Inputs + +- `isPlaying` (default `false`) — sets `EditorApplication.isPlaying`. +- `isPaused` (default `false`) — sets `EditorApplication.isPaused`. + +## Behavior + +Refuses any state change while `EditorUtility.scriptCompilationFailed` is true — instead throws with the compilation error details so the caller can fix them first. On success returns the post-change `EditorStatsData` snapshot. + +## How to Call + +```bash +unity-mcp-cli run-tool editor-application-set-state --input '{ + "isPlaying": false, + "isPaused": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool editor-application-set-state --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool editor-application-set-state --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `isPlaying` | `boolean` | No | If true, the 'playmode' will be started. If false, the 'playmode' will be stopped. | +| `isPaused` | `boolean` | No | If true, the 'playmode' will be paused. If false, the 'playmode' will be resumed. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "isPlaying": { + "type": "boolean" + }, + "isPaused": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.EditorStatsData", + "description": "Available information about 'UnityEditor.EditorApplication'." + } + }, + "$defs": { + "AIGD.EditorStatsData": { + "type": "object", + "properties": { + "IsPlaying": { + "type": "boolean", + "description": "Whether the Editor is in Play mode." + }, + "IsPaused": { + "type": "boolean", + "description": "Whether the Editor is paused." + }, + "IsCompiling": { + "type": "boolean", + "description": "Is editor currently compiling scripts? (Read Only)" + }, + "IsPlayingOrWillChangePlaymode": { + "type": "boolean", + "description": "Editor application state which is true only when the Editor is currently in or about to enter Play mode. (Read Only)" + }, + "IsUpdating": { + "type": "boolean", + "description": "True if the Editor is currently refreshing the AssetDatabase. (Read Only)" + }, + "ApplicationContentsPath": { + "type": "string", + "description": "Path to the Unity editor contents folder. (Read Only)" + }, + "ApplicationPath": { + "type": "string", + "description": "Gets the path to the Unity Editor application. (Read Only)" + }, + "TimeSinceStartup": { + "type": "number", + "description": "The time since the editor was started. (Read Only)" + } + }, + "required": [ + "IsPlaying", + "IsPaused", + "IsCompiling", + "IsPlayingOrWillChangePlaymode", + "IsUpdating", + "TimeSinceStartup" + ], + "description": "Available information about 'UnityEditor.EditorApplication'." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/editor-selection-get/SKILL.md b/.agent/skills/editor-selection-get/SKILL.md new file mode 100644 index 0000000..b91cb7b --- /dev/null +++ b/.agent/skills/editor-selection-get/SKILL.md @@ -0,0 +1,253 @@ +--- +name: editor-selection-get +description: Get information about the current Selection in the Unity Editor — active object, active transform, selected GameObjects, transforms, instance IDs, and asset GUIDs (each enrichment is opt-in). Pair with 'editor-selection-set' to change the selection. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Editor / Selection / Get + +Get information about the current Selection in the Unity Editor. Use 'editor-selection-set' tool to set the selection. + +## Toggles (default off where indicated to keep responses small) + +- `includeGameObjects` (default `false`) — populate `GameObjects[]`. +- `includeTransforms` (default `false`) — populate `Transforms[]` as `ComponentRef`s. +- `includeInstanceIDs` (default `false`) — populate `InstanceIDs[]`. +- `includeAssetGUIDs` (default `false`) — populate `AssetGUIDs[]` from project-window selection. +- `includeActiveObject` (default `true`) — populate `ActiveObject` as a generic `ObjectRef`. +- `includeActiveTransform` (default `true`) — populate `ActiveTransform` as a `ComponentRef`. + +`ActiveGameObject` and `ActiveInstanceID` are always populated. + +## How to Call + +```bash +unity-mcp-cli run-tool editor-selection-get --input '{ + "includeGameObjects": false, + "includeTransforms": false, + "includeInstanceIDs": false, + "includeAssetGUIDs": false, + "includeActiveObject": false, + "includeActiveTransform": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool editor-selection-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool editor-selection-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeGameObjects` | `boolean` | No | | +| `includeTransforms` | `boolean` | No | | +| `includeInstanceIDs` | `boolean` | No | | +| `includeAssetGUIDs` | `boolean` | No | | +| `includeActiveObject` | `boolean` | No | | +| `includeActiveTransform` | `boolean` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeGameObjects": { + "type": "boolean" + }, + "includeTransforms": { + "type": "boolean" + }, + "includeInstanceIDs": { + "type": "boolean" + }, + "includeAssetGUIDs": { + "type": "boolean" + }, + "includeActiveObject": { + "type": "boolean" + }, + "includeActiveTransform": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SelectionData" + } + }, + "$defs": { + "AIGD.GameObjectRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId-1": { + "type": "array", + "items": { + "$ref": "#/$defs/UnityEngine.EntityId" + } + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "AIGD.SelectionData": { + "type": "object", + "properties": { + "GameObjects": { + "$ref": "#/$defs/AIGD.GameObjectRef-1", + "description": "Returns the actual game object selection. Includes Prefabs, non-modifiable objects." + }, + "Transforms": { + "$ref": "#/$defs/AIGD.ComponentRef-1", + "description": "Returns the top level selection, excluding Prefabs." + }, + "InstanceIDs": { + "$ref": "#/$defs/UnityEngine.EntityId-1", + "description": "The actual unfiltered selection from the Scene returned as entity IDs instead of objects." + }, + "AssetGUIDs": { + "$ref": "#/$defs/System.String-1", + "description": "Returns the guids of the selected assets." + }, + "ActiveGameObject": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Returns the active game object. (The one shown in the inspector)." + }, + "ActiveInstanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Returns the entity ID of the actual object selection. Includes Prefabs, non-modifiable objects" + }, + "ActiveObject": { + "$ref": "#/$defs/AIGD.ObjectRef", + "description": "Returns the actual object selection. Includes Prefabs, non-modifiable objects." + }, + "ActiveTransform": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Returns the active transform. (The one shown in the inspector)." + } + }, + "required": [ + "ActiveInstanceID" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/editor-selection-set/SKILL.md b/.agent/skills/editor-selection-set/SKILL.md new file mode 100644 index 0000000..48e140a --- /dev/null +++ b/.agent/skills/editor-selection-set/SKILL.md @@ -0,0 +1,254 @@ +--- +name: editor-selection-set +description: Set the current Selection in the Unity Editor to the provided objects. All `ObjectRef`s must resolve to existing Unity objects; otherwise the call throws. Use 'editor-selection-get' to inspect the current selection first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Editor / Selection / Set + +Set the current Selection in the Unity Editor to the provided objects. Use 'editor-selection-get' tool to get the current selection first. + +## Inputs + +- `select` — array of `ObjectRef`. Every entry MUST resolve via `FindObject()`; otherwise the tool throws before touching `Selection.objects`. + +## Behavior + +Assigns the resolved array to `Selection.objects`, then calls `UnityEditorInternal.InternalEditorUtility.RepaintAllViews()` so Hierarchy/Inspector reflect the change. Returns the post-change `SelectionData` snapshot. + +## How to Call + +```bash +unity-mcp-cli run-tool editor-selection-set --input '{ + "select": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool editor-selection-set --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool editor-selection-set --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `select` | `any` | Yes | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "select": { + "$ref": "#/$defs/AIGD.ObjectRef-1" + } + }, + "$defs": { + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.ObjectRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ObjectRef", + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + } + } + }, + "required": [ + "select" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SelectionData" + } + }, + "$defs": { + "AIGD.GameObjectRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId-1": { + "type": "array", + "items": { + "$ref": "#/$defs/UnityEngine.EntityId" + } + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "AIGD.SelectionData": { + "type": "object", + "properties": { + "GameObjects": { + "$ref": "#/$defs/AIGD.GameObjectRef-1", + "description": "Returns the actual game object selection. Includes Prefabs, non-modifiable objects." + }, + "Transforms": { + "$ref": "#/$defs/AIGD.ComponentRef-1", + "description": "Returns the top level selection, excluding Prefabs." + }, + "InstanceIDs": { + "$ref": "#/$defs/UnityEngine.EntityId-1", + "description": "The actual unfiltered selection from the Scene returned as entity IDs instead of objects." + }, + "AssetGUIDs": { + "$ref": "#/$defs/System.String-1", + "description": "Returns the guids of the selected assets." + }, + "ActiveGameObject": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Returns the active game object. (The one shown in the inspector)." + }, + "ActiveInstanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Returns the entity ID of the actual object selection. Includes Prefabs, non-modifiable objects" + }, + "ActiveObject": { + "$ref": "#/$defs/AIGD.ObjectRef", + "description": "Returns the actual object selection. Includes Prefabs, non-modifiable objects." + }, + "ActiveTransform": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Returns the active transform. (The one shown in the inspector)." + } + }, + "required": [ + "ActiveInstanceID" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-component-add/SKILL.md b/.agent/skills/gameobject-component-add/SKILL.md new file mode 100644 index 0000000..a9c7972 --- /dev/null +++ b/.agent/skills/gameobject-component-add/SKILL.md @@ -0,0 +1,202 @@ +--- +name: gameobject-component-add +description: Add one or more Components to a GameObject in the opened Prefab or active Scene. Component types are looked up by full name (with namespace) or by class-name fallback. Use 'gameobject-find' to locate the host GameObject and 'gameobject-component-list-all' to discover valid component type names. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Component / Add + +Add Component to GameObject in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first. Use 'gameobject-component-list-all' tool to find the component type names to add. + +## Inputs + +- `componentNames` — list of component type names. Each entry may be a fully-qualified type name (preferred) or a bare class name (resolved via fallback to `AllComponentTypes`). +- `gameObjectRef` — the target GameObject. Required. + +## Behavior + +Per-name errors (unknown type, type not assignable to `UnityEngine.Component`, add-failed/duplicate) are accumulated in `response.Errors` / `response.Warnings` instead of throwing, so a single bad name does not abort the whole batch. Successful additions populate `response.AddedComponents` with `ComponentDataShallow` snapshots. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-component-add --input '{ + "componentNames": "string_value", + "gameObjectRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-component-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-component-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `componentNames` | `any` | Yes | Full name of the Component. It should include full namespace path and the class name. | +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "componentNames": { + "$ref": "#/$defs/System.String-1" + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "componentNames", + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.AddComponentResponse" + } + }, + "$defs": { + "System.Collections.Generic.List(AIGD.ComponentDataShallow)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentDataShallow" + } + }, + "AIGD.ComponentDataShallow": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "typeName": { + "type": "string" + }, + "isEnabled": { + "type": "string", + "enum": [ + "False", + "True", + "NA" + ] + } + }, + "required": [ + "instanceID", + "isEnabled" + ] + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.AddComponentResponse": { + "type": "object", + "properties": { + "AddedComponents": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.ComponentDataShallow)", + "description": "List of successfully added components." + }, + "Messages": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of success messages for added components." + }, + "Warnings": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of warnings encountered during component addition." + }, + "Errors": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of errors encountered during component addition." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-component-destroy/SKILL.md b/.agent/skills/gameobject-component-destroy/SKILL.md new file mode 100644 index 0000000..e0443c7 --- /dev/null +++ b/.agent/skills/gameobject-component-destroy/SKILL.md @@ -0,0 +1,209 @@ +--- +name: gameobject-component-destroy +description: Destroy one or more Components from a target GameObject. Missing (null) components are skipped — they cannot be destroyed. Use 'gameobject-find' and 'gameobject-component-get' to identify the components first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Component / Destroy + +Destroy one or many components from target GameObject. Can't destroy missed components. Use 'gameobject-find' tool to find the target GameObject and 'gameobject-component-get' to get component details first. + +## Inputs + +- `gameObjectRef` — the host GameObject. +- `destroyComponentRefs` — `ComponentRefList` of components to destroy (matched against the GameObject's components). + +## Behavior + +Iterates `go.GetComponents()`, skipping null entries (missing scripts). For each non-null component that matches one of `destroyComponentRefs`, the tool snapshots a `ComponentRef`, calls `Object.DestroyImmediate`, and records the destroyed reference. If no component matches at all, throws with the help text from `Error.NotFoundComponents` (which includes a preview of all available components on the GameObject). + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-component-destroy --input '{ + "gameObjectRef": "string_value", + "destroyComponentRefs": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-component-destroy --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-component-destroy --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | +| `destroyComponentRefs` | `any` | Yes | Component reference array. Used to find Component at GameObject. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "destroyComponentRefs": { + "$ref": "#/$defs/AIGD.ComponentRefList" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "AIGD.ComponentRefList": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Component reference. Used to find a Component at GameObject." + }, + "description": "Component reference array. Used to find Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "destroyComponentRefs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.DestroyComponentsResponse" + } + }, + "$defs": { + "AIGD.ComponentRefList": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Component reference. Used to find a Component at GameObject." + }, + "description": "Component reference array. Used to find Component at GameObject." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.DestroyComponentsResponse": { + "type": "object", + "properties": { + "DestroyedComponents": { + "$ref": "#/$defs/AIGD.ComponentRefList", + "description": "List of destroyed components." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-component-get/SKILL.md b/.agent/skills/gameobject-component-get/SKILL.md new file mode 100644 index 0000000..62ab1af --- /dev/null +++ b/.agent/skills/gameobject-component-get/SKILL.md @@ -0,0 +1,346 @@ +--- +name: gameobject-component-get +description: Get detailed information about a specific Component on a GameObject — type, enabled state, and (optionally) serialized fields and properties. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'gameobject-find' to list components first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Component / Get + +Get detailed information about a specific Component on a GameObject. Returns component type, enabled state, and optionally serialized fields and properties. Use this to inspect component data before modifying it. Use 'gameobject-find' tool to get the list of all components on the GameObject. + +## Inputs + +- `gameObjectRef` — the host GameObject. +- `componentRef` — the specific component to inspect (matched by index or instance ID). +- `includeFields` (default `true`) — populate the legacy `Fields` list. +- `includeProperties` (default `true`) — populate the legacy `Properties` list. +- `deepSerialization` (default `false`) — when populating legacy lists, recurse into nested members. + +## Path-scoped reads (token-saving) + +Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. The result is returned in the `View` field of the response, and the legacy `Fields`/`Properties` lists are skipped. These two parameters are mutually exclusive — supply at most one. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-component-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "includeFields": false, + "includeProperties": false, + "deepSerialization": false, + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-component-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-component-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | +| `componentRef` | `any` | Yes | Component reference. Used to find a Component at GameObject. | +| `includeFields` | `boolean` | No | Include serialized fields of the component. | +| `includeProperties` | `boolean` | No | Include serialized properties of the component. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including all nested objects. Otherwise, only serializes top-level members. | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. When supplied, the legacy 'Fields'/'Properties' lists are skipped and the result is returned in 'View'. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View. When supplied, the legacy 'Fields'/'Properties' lists are skipped and the filtered subtree is returned in 'View'. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "includeFields": { + "type": "boolean" + }, + "includeProperties": { + "type": "boolean" + }, + "deepSerialization": { + "type": "boolean" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + }, + "required": [ + "gameObjectRef", + "componentRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.GetComponentResponse" + } + }, + "$defs": { + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.ComponentDataShallow": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "typeName": { + "type": "string" + }, + "isEnabled": { + "type": "string", + "enum": [ + "False", + "True", + "NA" + ] + } + }, + "required": [ + "instanceID", + "isEnabled" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "AIGD.GetComponentResponse": { + "type": "object", + "properties": { + "Reference": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the component for future operations." + }, + "Index": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "Component": { + "$ref": "#/$defs/AIGD.ComponentDataShallow", + "description": "Basic component information (type, enabled state)." + }, + "Fields": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)", + "description": "Serialized fields of the component. Populated only on the legacy code path (no 'paths' / no 'viewQuery')." + }, + "Properties": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)", + "description": "Serialized properties of the component. Populated only on the legacy code path (no 'paths' / no 'viewQuery')." + }, + "View": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' was supplied. Null otherwise." + } + }, + "required": [ + "Index" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-component-list-all/SKILL.md b/.agent/skills/gameobject-component-list-all/SKILL.md new file mode 100644 index 0000000..c2e84dc --- /dev/null +++ b/.agent/skills/gameobject-component-list-all/SKILL.md @@ -0,0 +1,133 @@ +--- +name: gameobject-component-list-all +description: List the fully-qualified C# type names of every concrete `UnityEngine.Component` subclass available in the project. Paginated (default 5/page, max 500). Use this to find a valid `componentName` for 'gameobject-component-add'. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Component / List All + +List C# class names extended from UnityEngine.Component. Use this to find component type names for 'gameobject-component-add' tool. Results are paginated to avoid overwhelming responses. + +## Inputs + +- `search` (optional) — case-insensitive substring filter on type names. +- `page` (default 0, 0-based) — page index. +- `pageSize` (default 5, range 1..500) — items per page. + +## Behavior + +Enumerates `AllComponentTypes` (every non-abstract subclass of `UnityEngine.Component`), filters by `search` if supplied, then returns a `ComponentListResult` containing the requested page plus `TotalCount` / `TotalPages` so the caller can iterate. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-component-list-all --input '{ + "search": "string_value", + "page": 0, + "pageSize": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-component-list-all --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-component-list-all --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `search` | `string` | No | Substring for searching components. Could be empty. | +| `page` | `integer` | No | Page number (0-based). Default is 0. | +| `pageSize` | `integer` | No | Number of items per page. Default is 5. Max is 500. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "search": { + "type": "string" + }, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ComponentListResult" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.ComponentListResult": { + "type": "object", + "properties": { + "Items": { + "$ref": "#/$defs/System.String-1", + "description": "Array of component type names for the current page." + }, + "Page": { + "type": "integer", + "description": "Current page number (0-based)." + }, + "PageSize": { + "type": "integer", + "description": "Number of items per page." + }, + "TotalCount": { + "type": "integer", + "description": "Total number of matching components." + }, + "TotalPages": { + "type": "integer", + "description": "Total number of pages available." + } + }, + "required": [ + "Page", + "PageSize", + "TotalCount", + "TotalPages" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-component-modify/SKILL.md b/.agent/skills/gameobject-component-modify/SKILL.md new file mode 100644 index 0000000..c70ce92 --- /dev/null +++ b/.agent/skills/gameobject-component-modify/SKILL.md @@ -0,0 +1,331 @@ +--- +name: gameobject-component-modify +description: Modify a specific Component on a GameObject in opened Prefab or in a Scene. Allows direct modification of component fields and properties without wrapping in GameObject structure. Use 'gameobject-component-get' first to inspect the component structure before modifying. Three modification surfaces are available (componentDiff, pathPatches, jsonPatch) — see the skill body for details. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Component / Modify + +## Three modification surfaces + +Use whichever fits the task: + +1. `componentDiff` — full `SerializedMember` diff (legacy, backwards compatible). +2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`; atomic per-path modification, multiple entries can target different depths. +3. `jsonPatch` — a JSON Merge Patch (RFC 7396, extended with `[i]`/`[key]` notation) routed through `Reflector.TryPatch`; multiple fields at any depth in a single call. + +When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `componentDiff`. At least one is required. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-component-modify --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "componentDiff": "string_value", + "pathPatches": "string_value", + "jsonPatch": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-component-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-component-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | +| `componentRef` | `any` | Yes | Component reference. Used to find a Component at GameObject. | +| `componentDiff` | `any` | No | Optional. The full component data to apply (legacy path). Should contain 'fields' and/or 'props' with the values to modify. +Only include the fields/properties you want to change. +Any unknown or invalid fields and properties will be reported in the response. | +| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. Each entry targets one field/element/entry by path. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. | +| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. Allows multiple fields at any depth to be updated in a single call. Use '$type' for compatible-subtype replacement. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "componentDiff": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "pathPatches": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)" + }, + "jsonPatch": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": true + } + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.PathPatch": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required." + }, + "Value": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember." + } + } + }, + "System.Collections.Generic.List(AIGD.PathPatch)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PathPatch" + } + } + }, + "required": [ + "gameObjectRef", + "componentRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ModifyComponentResponse" + } + }, + "$defs": { + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.ComponentDataShallow": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "typeName": { + "type": "string" + }, + "isEnabled": { + "type": "string", + "enum": [ + "False", + "True", + "NA" + ] + } + }, + "required": [ + "instanceID", + "isEnabled" + ] + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.ModifyComponentResponse": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "Reference": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "Index": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "Component": { + "$ref": "#/$defs/AIGD.ComponentDataShallow", + "description": "Updated component information after modification." + }, + "Logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications made and any warnings/errors encountered." + } + }, + "required": [ + "Success", + "Index" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-create/SKILL.md b/.agent/skills/gameobject-create/SKILL.md new file mode 100644 index 0000000..2b67d3d --- /dev/null +++ b/.agent/skills/gameobject-create/SKILL.md @@ -0,0 +1,231 @@ +--- +name: gameobject-create +description: Create a new GameObject in the currently opened Prefab or active Scene, optionally parented under another GameObject and pre-positioned. Pass `primitiveType` to spawn a Unity primitive (Cube, Sphere, etc.) instead of an empty GameObject. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Create + +Create a new GameObject in opened Prefab or in a Scene. If needed - provide proper 'position', 'rotation' and 'scale' to reduce amount of operations. + +## Inputs + +- `name` — required non-empty name. +- `parentGameObjectRef` (optional) — when provided, the new GameObject is parented under this one (`SetParent(parent, worldPositionStays: false)`); otherwise it's created at scene/prefab root. +- `position` / `rotation` / `scale` — optional transform; default to zero / zero / one. +- `isLocalSpace` — when `true`, applies the transform in local space relative to the parent. +- `primitiveType` (optional) — when set, the GameObject is created via `GameObject.CreatePrimitive` (adds the appropriate renderer/collider for the primitive shape). + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-create --input '{ + "name": "string_value", + "parentGameObjectRef": "string_value", + "position": "string_value", + "rotation": "string_value", + "scale": "string_value", + "isLocalSpace": false, + "primitiveType": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | Yes | Name of the new GameObject. | +| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the GameObject will be created at the root of the scene or prefab. | +| `position` | `any` | No | Transform position of the GameObject. | +| `rotation` | `any` | No | Transform rotation of the GameObject. Euler angles in degrees. | +| `scale` | `any` | No | Transform scale of the GameObject. | +| `isLocalSpace` | `boolean` | No | World or Local space of transform. | +| `primitiveType` | `any` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "isLocalSpace": { + "type": "boolean" + }, + "primitiveType": { + "$ref": "#/$defs/UnityEngine.PrimitiveType" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "UnityEngine.PrimitiveType": { + "type": "string", + "enum": [ + "Sphere", + "Capsule", + "Cylinder", + "Cube", + "Plane", + "Quad" + ] + } + }, + "required": [ + "name" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-destroy/SKILL.md b/.agent/skills/gameobject-destroy/SKILL.md new file mode 100644 index 0000000..e53c13d --- /dev/null +++ b/.agent/skills/gameobject-destroy/SKILL.md @@ -0,0 +1,149 @@ +--- +name: gameobject-destroy +description: Destroy a GameObject (and all nested children) in the currently opened Prefab or active Scene. Returns the destroyed GameObject's name, path, and instance ID for confirmation. Use 'gameobject-find' to locate the target first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Destroy + +Destroy GameObject and all nested GameObjects recursively in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first. + +## Behavior + +Validates the `gameObjectRef`, resolves it on the main thread, then calls `Object.DestroyImmediate` (the immediate variant is required for Editor-mode operations). Returns a `DestroyGameObjectResult` containing `DestroyedName`, `DestroyedPath`, and `DestroyedInstanceId` so the caller has a record of what was removed. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-destroy --input '{ + "gameObjectRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-destroy --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-destroy --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.DestroyGameObjectResult" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.DestroyGameObjectResult": { + "type": "object", + "properties": { + "DestroyedName": { + "type": "string", + "description": "Name of the destroyed GameObject." + }, + "DestroyedPath": { + "type": "string", + "description": "Hierarchy path of the destroyed GameObject." + }, + "DestroyedInstanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance ID of the destroyed GameObject." + } + }, + "required": [ + "DestroyedInstanceId" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-duplicate/SKILL.md b/.agent/skills/gameobject-duplicate/SKILL.md new file mode 100644 index 0000000..7731f0a --- /dev/null +++ b/.agent/skills/gameobject-duplicate/SKILL.md @@ -0,0 +1,184 @@ +--- +name: gameobject-duplicate +description: Duplicate a batch of GameObjects in the currently opened Prefab or active Scene. Marks each affected scene as dirty after duplication. Use 'gameobject-find' to locate the source GameObjects first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Duplicate + +Duplicate GameObjects in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObjects first. + +## Inputs + +- `gameObjectRefs` — `GameObjectRefList` of source GameObjects. + +## Behavior + +Resolves every input ref on the main thread (throwing on any unresolved entry to keep the batch atomic). Sets `Selection.entityIds`/`instanceIDs` to the sources and invokes `Unsupported.DuplicateGameObjectsUsingPasteboard()` (Unity's canonical duplicate routine). Marks every distinct affected scene dirty so the duplicated objects are saved with the scene. Returns refs to the sources (the duplicates are reachable via the post-call `Selection`). + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-duplicate --input '{ + "gameObjectRefs": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-duplicate --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-duplicate --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRefs` | `any` | Yes | Array of GameObjects in opened Prefab or in the active Scene. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRefs": { + "$ref": "#/$defs/AIGD.GameObjectRefList" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRefList": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "description": "Array of GameObjects in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRefs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectRef)" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "System.Collections.Generic.List(AIGD.GameObjectRef)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-find/SKILL.md b/.agent/skills/gameobject-find/SKILL.md new file mode 100644 index 0000000..7680f4b --- /dev/null +++ b/.agent/skills/gameobject-find/SKILL.md @@ -0,0 +1,423 @@ +--- +name: gameobject-find +description: Find a specific GameObject in the opened Prefab (preferred when present) or the active Scene. Optionally include editable data, components preview, bounds, and limited hierarchy. Supports token-saving path-scoped reads via `paths` or `viewQuery`. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Find + +Finds specific GameObject by provided information in opened Prefab or in a Scene. First it looks for the opened Prefab, if any Prefab is opened it looks only there ignoring a scene. If no opened Prefab it looks into current active scene. Returns GameObject information and its children. Also, it returns Components preview just for the target GameObject. + +## Toggles (all default `false` to keep responses small) + +- `includeData` — full editable GameObject data (tag, layer, etc.). +- `includeComponents` — attached components references. +- `includeBounds` — 3D bounds. +- `includeHierarchy` — hierarchy metadata. +- `hierarchyDepth` (default 0) — depth of the hierarchy to include. `0` = target only, `1` = one layer below, etc. + +## Path-scoped reads (token-saving) + +Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. When either is supplied, the result populates `Data` on the returned `GameObjectData` and overrides `includeData` (which would otherwise produce a full recursive serialization). These two parameters are mutually exclusive — supply at most one. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-find --input '{ + "gameObjectRef": "string_value", + "includeData": false, + "includeComponents": false, + "includeBounds": false, + "includeHierarchy": false, + "hierarchyDepth": 0, + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-find --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-find --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. | +| `includeData` | `boolean` | No | Include editable GameObject data (tag, layer, etc). | +| `includeComponents` | `boolean` | No | Include attached components references. | +| `includeBounds` | `boolean` | No | Include 3D bounds of the GameObject. | +| `includeHierarchy` | `boolean` | No | Include hierarchy metadata. | +| `hierarchyDepth` | `integer` | No | Determines the depth of the hierarchy to include. 0 - means only the target GameObject. 1 - means to include one layer below. | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. When supplied, replaces 'includeData'-style full serialization with a path-scoped aggregate. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View. When supplied, replaces 'includeData'-style full serialization with the filtered subtree. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "includeData": { + "type": "boolean" + }, + "includeComponents": { + "type": "boolean" + }, + "includeBounds": { + "type": "boolean" + }, + "includeHierarchy": { + "type": "boolean" + }, + "hierarchyDepth": { + "type": "integer" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.GameObjectData" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "UnityEngine.Bounds": { + "type": "object", + "properties": { + "center": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ] + }, + "size": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ] + } + }, + "required": [ + "center", + "size" + ], + "additionalProperties": false + }, + "AIGD.GameObjectMetadata": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sceneName": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "activeSelf": { + "type": "boolean" + }, + "activeInHierarchy": { + "type": "boolean" + }, + "children": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectMetadata)" + } + }, + "required": [ + "instanceID", + "activeSelf", + "activeInHierarchy" + ] + }, + "System.Collections.Generic.List(AIGD.GameObjectMetadata)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectMetadata" + } + }, + "AIGD.ComponentDataShallow-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentDataShallow" + } + }, + "AIGD.ComponentDataShallow": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "typeName": { + "type": "string" + }, + "isEnabled": { + "type": "string", + "enum": [ + "False", + "True", + "NA" + ] + } + }, + "required": [ + "instanceID", + "isEnabled" + ] + }, + "AIGD.GameObjectData": { + "type": "object", + "properties": { + "Reference": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "Data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "GameObject editable data (tag, layer, etc)." + }, + "Bounds": { + "$ref": "#/$defs/UnityEngine.Bounds", + "description": "Bounds of the GameObject." + }, + "Hierarchy": { + "$ref": "#/$defs/AIGD.GameObjectMetadata", + "description": "Hierarchy metadata of the GameObject." + }, + "Components": { + "$ref": "#/$defs/AIGD.ComponentDataShallow-1", + "description": "Attached components shallow data of the GameObject (Read-only, use Component modification tool for modification)." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-modify/SKILL.md b/.agent/skills/gameobject-modify/SKILL.md new file mode 100644 index 0000000..cffb149 --- /dev/null +++ b/.agent/skills/gameobject-modify/SKILL.md @@ -0,0 +1,262 @@ +--- +name: gameobject-modify +description: Modify GameObject fields and properties in opened Prefab or in a Scene. You can modify multiple GameObjects at once. Just provide the same number of GameObject references and SerializedMember objects. Three modification surfaces are available per GameObject (gameObjectDiffs, pathPatchesPerGameObject, jsonPatchesPerGameObject) — see the skill body for details. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Modify + +## Three modification surfaces + +Per GameObject — parallel arrays must have the same length as `gameObjectRefs`: + +1. `gameObjectDiffs` — full `SerializedMember` diff per GameObject (legacy, backwards compatible). +2. `pathPatchesPerGameObject` — list of `{path, value}` patches per GameObject routed through `Reflector.TryModifyAt`; atomic per-path modification. +3. `jsonPatchesPerGameObject` — JSON Merge Patch per GameObject routed through `Reflector.TryPatch`. + +When more than one is supplied for the same GameObject they run in this order: `jsonPatch` → `pathPatches` → `diff`. At least one of the three is required. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-modify --input '{ + "gameObjectRefs": "string_value", + "gameObjectDiffs": "string_value", + "pathPatchesPerGameObject": "string_value", + "jsonPatchesPerGameObject": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRefs` | `any` | Yes | Array of GameObjects in opened Prefab or in the active Scene. | +| `gameObjectDiffs` | `any` | No | Optional. Each item in the array represents a GameObject modification of the 'gameObjectRefs' at the same index. Usually a GameObject is a container for components. Each component may have fields and properties for modification. If you need to modify components of a GameObject, please use 'gameobject-component-modify' tool. Ignore values that should not be modified. Any unknown or wrong located fields and properties will be ignored. Check the result of this command to see what was changed. The ignored fields and properties will be listed. | +| `pathPatchesPerGameObject` | `any` | No | Optional. Per-GameObject list of path-scoped patches routed through Reflector.TryModifyAt. Outer index aligns with 'gameObjectRefs'; inner list contains {path, value} entries. Pass null or omit for GameObjects that should not receive path patches. | +| `jsonPatchesPerGameObject` | `any` | No | Optional. Per-GameObject JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. Outer index aligns with 'gameObjectRefs'. Pass null or omit for GameObjects that should not receive a JSON patch. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRefs": { + "$ref": "#/$defs/AIGD.GameObjectRefList" + }, + "gameObjectDiffs": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList" + }, + "pathPatchesPerGameObject": { + "$ref": "#/$defs/System.Collections.Generic.List(System.Collections.Generic.List(AIGD.PathPatch))" + }, + "jsonPatchesPerGameObject": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRefList": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "description": "Array of GameObjects in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "System.Collections.Generic.List(AIGD.PathPatch)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PathPatch" + } + }, + "AIGD.PathPatch": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required." + }, + "Value": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember." + } + } + }, + "System.Collections.Generic.List(System.Collections.Generic.List(AIGD.PathPatch))": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)" + } + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "gameObjectRefs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.Logs" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.LogEntry": { + "type": "object", + "properties": { + "Depth": { + "type": "integer" + }, + "Message": { + "type": "string" + }, + "Type": { + "type": "string", + "enum": [ + "Trace", + "Debug", + "Info", + "Success", + "Warning", + "Error", + "Critical" + ] + } + }, + "required": [ + "Depth", + "Type" + ] + }, + "com.IvanMurzak.ReflectorNet.Model.Logs": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.LogEntry" + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/gameobject-set-parent/SKILL.md b/.agent/skills/gameobject-set-parent/SKILL.md new file mode 100644 index 0000000..828e9fc --- /dev/null +++ b/.agent/skills/gameobject-set-parent/SKILL.md @@ -0,0 +1,148 @@ +--- +name: gameobject-set-parent +description: Reparent a batch of GameObjects under a new parent in the currently opened Prefab or active Scene. Per-item failures are reported in the returned status string instead of aborting the batch. Use 'gameobject-find' to locate the GameObjects first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# GameObject / Set Parent + +Set parent GameObject to list of GameObjects in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObjects first. + +## Inputs + +- `gameObjectRefs` — list of children to reparent. +- `parentGameObjectRef` — new parent. Must resolve, otherwise the call returns early with an error string. +- `worldPositionStays` (default `true`) — preserve world-space transform when reparenting (passed to `Transform.SetParent`). + +## Behavior + +Iterates `gameObjectRefs` and reparents each one independently; per-item resolve errors are appended to the returned status string instead of throwing. After the loop, if at least one reparent succeeded, marks the active scene dirty and repaints editor windows. + +## How to Call + +```bash +unity-mcp-cli run-tool gameobject-set-parent --input '{ + "gameObjectRefs": "string_value", + "parentGameObjectRef": "string_value", + "worldPositionStays": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool gameobject-set-parent --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool gameobject-set-parent --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRefs` | `any` | Yes | List of references to the GameObjects to set new parent. | +| `parentGameObjectRef` | `any` | Yes | Reference to the parent GameObject. | +| `worldPositionStays` | `boolean` | No | A boolean flag indicating whether the GameObject's world position should remain unchanged when setting its parent. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRefs": { + "$ref": "#/$defs/AIGD.GameObjectRefList" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "worldPositionStays": { + "type": "boolean" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRefList": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "description": "Array of GameObjects in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRefs", + "parentGameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-action-add/SKILL.md b/.agent/skills/inputsystem-action-add/SKILL.md new file mode 100644 index 0000000..afd7622 --- /dev/null +++ b/.agent/skills/inputsystem-action-add/SKILL.md @@ -0,0 +1,177 @@ +--- +name: inputsystem-action-add +description: Add an Action (with type and optional expectedControlType) to an ActionMap in a `.inputactions` asset, optionally with an initial binding path, and save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Add Action + +Add an `InputAction` to an existing `InputActionMap`. An Action represents a single input intent (e.g. 'Jump', 'Move', 'Fire'). + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` — required. Name of the ActionMap to add the Action to. +- `actionName` — required. Name of the new Action (unique within the map). +- `actionType` — input behavior type: `Button` (default), `Value`, or `PassThrough`. +- `expectedControlType` — optional control layout the action expects (e.g. `Button`, `Vector2`, `Axis`). +- `binding` — optional initial binding control path (e.g. `/buttonSouth`). +- `groups` / `interactions` / `processors` — optional binding metadata applied to the initial binding. + +## Behavior + +Loads the asset, adds the Action to the named map (failing if the action name already exists), sets its `expectedControlType` when provided, saves and re-imports the asset. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-action-add --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value", + "actionType": "string_value", + "expectedControlType": "string_value", + "binding": "string_value", + "groups": "string_value", + "interactions": "string_value", + "processors": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-action-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-action-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap to add the Action to. | +| `actionName` | `string` | Yes | Name of the new Action (unique within the map). | +| `actionType` | `string` | No | Input behavior type: Button (default), Value, or PassThrough. | +| `expectedControlType` | `string` | No | Optional expected control type / layout (e.g. 'Button', 'Vector2', 'Axis'). | +| `binding` | `string` | No | Optional initial binding control path (e.g. '/buttonSouth'). | +| `groups` | `string` | No | Optional binding group(s) for the initial binding (semicolon-separated). | +| `interactions` | `string` | No | Optional interactions for the initial binding (e.g. 'press,hold'). | +| `processors` | `string` | No | Optional processors for the initial binding (e.g. 'invert'). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + }, + "actionType": { + "type": "string", + "enum": [ + "Value", + "Button", + "PassThrough" + ] + }, + "expectedControlType": { + "type": "string" + }, + "binding": { + "type": "string" + }, + "groups": { + "type": "string" + }, + "interactions": { + "type": "string" + }, + "processors": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName", + "actionName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap the Action was added to." + }, + "actionName": { + "type": "string", + "description": "Name of the added Action." + }, + "actionType": { + "type": "string", + "description": "Resolved input behavior type." + }, + "expectedControlType": { + "type": "string", + "description": "Resolved expected control type, or null." + }, + "bindingCount": { + "type": "integer", + "description": "Number of bindings on the new Action." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "bindingCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-action-remove/SKILL.md b/.agent/skills/inputsystem-action-remove/SKILL.md new file mode 100644 index 0000000..d3cc6d5 --- /dev/null +++ b/.agent/skills/inputsystem-action-remove/SKILL.md @@ -0,0 +1,130 @@ +--- +name: inputsystem-action-remove +description: Remove an Action (and its Bindings) from an ActionMap in a `.inputactions` asset and save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Remove Action + +Remove an `InputAction` from an `InputActionMap`. This deletes the Action and every Binding associated with it. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` — required. Name of the ActionMap containing the Action. +- `actionName` — required. Name of the Action to remove. + +## Behavior + +Loads the asset, removes the named Action from the map (failing if it does not exist), saves and re-imports the asset. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-action-remove --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-action-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-action-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap containing the Action. | +| `actionName` | `string` | Yes | Name of the Action to remove. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName", + "actionName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionRemoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionRemoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap the Action was removed from." + }, + "actionName": { + "type": "string", + "description": "Name of the removed Action." + }, + "actionCount": { + "type": "integer", + "description": "Number of Actions remaining in the map." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "actionCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-actionmap-add/SKILL.md b/.agent/skills/inputsystem-actionmap-add/SKILL.md new file mode 100644 index 0000000..0e885c3 --- /dev/null +++ b/.agent/skills/inputsystem-actionmap-add/SKILL.md @@ -0,0 +1,119 @@ +--- +name: inputsystem-actionmap-add +description: Add a new ActionMap to an existing `.inputactions` InputActionAsset and save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Add ActionMap + +Add a new `InputActionMap` to an InputActionAsset. An ActionMap groups related Actions (e.g. a 'Player' map and a 'UI' map). + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` — required. Name of the new ActionMap. Must be unique within the asset. + +## Behavior + +Loads the asset, adds the ActionMap (failing if a map of that name already exists), saves the asset back to disk, and re-imports it. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-actionmap-add --input '{ + "assetPath": "string_value", + "mapName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-actionmap-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-actionmap-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the new ActionMap (unique within the asset). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionMapAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionMapAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the added ActionMap." + }, + "actionMapCount": { + "type": "integer", + "description": "Total number of ActionMaps in the asset after the addition." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "actionMapCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-actionmap-remove/SKILL.md b/.agent/skills/inputsystem-actionmap-remove/SKILL.md new file mode 100644 index 0000000..d3024c3 --- /dev/null +++ b/.agent/skills/inputsystem-actionmap-remove/SKILL.md @@ -0,0 +1,119 @@ +--- +name: inputsystem-actionmap-remove +description: Remove an ActionMap (and all its Actions and Bindings) from a `.inputactions` asset and save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Remove ActionMap + +Remove an `InputActionMap` from an InputActionAsset. This deletes the map along with every Action and Binding it contains. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` — required. Name of the ActionMap to remove. + +## Behavior + +Loads the asset, removes the named ActionMap (failing if it does not exist), saves and re-imports the asset. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-actionmap-remove --input '{ + "assetPath": "string_value", + "mapName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-actionmap-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-actionmap-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap to remove. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionMapRemoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionMapRemoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the removed ActionMap." + }, + "actionMapCount": { + "type": "integer", + "description": "Total number of ActionMaps remaining in the asset." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "actionMapCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-asset-create/SKILL.md b/.agent/skills/inputsystem-asset-create/SKILL.md new file mode 100644 index 0000000..0e94973 --- /dev/null +++ b/.agent/skills/inputsystem-asset-create/SKILL.md @@ -0,0 +1,113 @@ +--- +name: inputsystem-asset-create +description: Create a new `.inputactions` InputActionAsset at an 'Assets/'-rooted path, optionally seeding an initial ActionMap. Returns the created asset path. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Create InputActionAsset + +Create a new Unity Input System `InputActionAsset` (a `.inputactions` file). This is the container for ActionMaps, Actions, Bindings and Control Schemes. + +## Inputs + +- `assetPath` — required. An 'Assets/'-rooted path ending in `.inputactions` (e.g. `Assets/Input/Player.inputactions`). Intermediate folders must already exist (use 'assets-create-folder'). +- `initialActionMap` — optional. When provided, an empty ActionMap with this name is added to the new asset. + +## Behavior + +Creates an empty `InputActionAsset`, optionally adds the initial ActionMap, serializes it to JSON, writes the file, and imports it into the AssetDatabase. Fails if an asset already exists at the path. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-asset-create --input '{ + "assetPath": "string_value", + "initialActionMap": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-asset-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-asset-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path ending in '.inputactions' for the new asset. | +| `initialActionMap` | `string` | No | Optional name for an initial ActionMap to add to the new asset. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "initialActionMap": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-AssetCreateResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-AssetCreateResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the created InputActionAsset." + }, + "initialActionMap": { + "type": "string", + "description": "Name of the initial ActionMap that was added, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the asset was created successfully." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-binding-add/SKILL.md b/.agent/skills/inputsystem-binding-add/SKILL.md new file mode 100644 index 0000000..0c5f932 --- /dev/null +++ b/.agent/skills/inputsystem-binding-add/SKILL.md @@ -0,0 +1,164 @@ +--- +name: inputsystem-binding-add +description: Add a simple (non-composite) Binding to an Action in a `.inputactions` asset, with an optional control path, groups, interactions and processors, then save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Add Binding + +Add an `InputBinding` to an existing `InputAction`. A binding maps a physical control path (e.g. `/space`) to the Action. For composite bindings (2DVector / 1DAxis) use 'inputsystem-binding-composite-add' instead. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` — required. ActionMap containing the Action. +- `actionName` — required. Action to add the binding to. +- `path` — control path (e.g. `/space`, `/leftStick`). +- `groups` — optional control-scheme group(s) (semicolon-separated, e.g. `Keyboard&Mouse`). +- `interactions` — optional interactions (e.g. `hold`, `press,tap`). +- `processors` — optional processors (e.g. `invert`, `scale(factor=2)`). + +## Behavior + +Loads the asset, resolves the Action, appends a binding with the supplied metadata, saves and re-imports the asset, and returns the new binding's index. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-binding-add --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value", + "path": "string_value", + "groups": "string_value", + "interactions": "string_value", + "processors": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap containing the Action. | +| `actionName` | `string` | Yes | Name of the Action to add the binding to. | +| `path` | `string` | Yes | Control path for the binding (e.g. '/space'). | +| `groups` | `string` | No | Optional control-scheme group(s), semicolon-separated. | +| `interactions` | `string` | No | Optional interactions (e.g. 'hold', 'press,tap'). | +| `processors` | `string` | No | Optional processors (e.g. 'invert'). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + }, + "path": { + "type": "string" + }, + "groups": { + "type": "string" + }, + "interactions": { + "type": "string" + }, + "processors": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName", + "actionName", + "path" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap." + }, + "actionName": { + "type": "string", + "description": "Name of the Action." + }, + "path": { + "type": "string", + "description": "The control path that was bound." + }, + "bindingIndex": { + "type": "integer", + "description": "Index of the new binding within the Action's binding list." + }, + "bindingCount": { + "type": "integer", + "description": "Number of bindings on the Action after the addition." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "bindingIndex", + "bindingCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-binding-composite-add/SKILL.md b/.agent/skills/inputsystem-binding-composite-add/SKILL.md new file mode 100644 index 0000000..b1ede46 --- /dev/null +++ b/.agent/skills/inputsystem-binding-composite-add/SKILL.md @@ -0,0 +1,187 @@ +--- +name: inputsystem-binding-composite-add +description: Add a composite Binding (e.g. `2DVector` / WASD, `1DAxis`) with its named parts to an Action in a `.inputactions` asset, then save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Add Composite Binding + +Add a composite `InputBinding` to an `InputAction`. A composite synthesizes a value (e.g. a `Vector2`) from several part bindings. The classic example is a `2DVector` (WASD) composite with `up`/`down`/`left`/`right` parts; a `1DAxis` composite has `negative`/`positive` parts. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` / `actionName` — required. The Action that receives the composite. +- `composite` — composite type, e.g. `2DVector`, `1DAxis`, `Axis`, `Dpad` (default `2DVector`). +- `parts` — required. One or more `{ name, path }` entries (e.g. `up` → `/w`). +- `interactions` / `processors` — optional, applied to the composite root. + +## Behavior + +Loads the asset, resolves the Action, adds the composite via `AddCompositeBinding` and chains each part via `.With(name, path)`, saves and re-imports the asset. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-binding-composite-add --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value", + "parts": "string_value", + "composite": "string_value", + "interactions": "string_value", + "processors": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-composite-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-composite-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap containing the Action. | +| `actionName` | `string` | Yes | Name of the Action to add the composite to. | +| `parts` | `any` | Yes | Composite parts: each entry has a 'name' (e.g. 'up') and a control 'path' (e.g. '/w'). | +| `composite` | `string` | No | Composite type, e.g. '2DVector' (default), '1DAxis', 'Axis', 'Dpad'. | +| `interactions` | `string` | No | Optional interactions applied to the composite root. | +| `processors` | `string` | No | Optional processors applied to the composite root. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + }, + "parts": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-CompositePart-1" + }, + "composite": { + "type": "string" + }, + "interactions": { + "type": "string" + }, + "processors": { + "type": "string" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-CompositePart": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Part name within the composite (e.g. 'up', 'down', 'left', 'right', 'negative', 'positive')." + }, + "path": { + "type": "string", + "description": "Control path bound to this part (e.g. '/w')." + }, + "groups": { + "type": "string", + "description": "Optional control-scheme group(s) for this part." + } + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-CompositePart-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-CompositePart" + } + } + }, + "required": [ + "assetPath", + "mapName", + "actionName", + "parts" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingCompositeAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingCompositeAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap." + }, + "actionName": { + "type": "string", + "description": "Name of the Action." + }, + "composite": { + "type": "string", + "description": "The composite type that was added." + }, + "partCount": { + "type": "integer", + "description": "Number of composite parts added." + }, + "bindingCount": { + "type": "integer", + "description": "Number of bindings on the Action after the addition (composite root + parts)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "partCount", + "bindingCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-binding-remove/SKILL.md b/.agent/skills/inputsystem-binding-remove/SKILL.md new file mode 100644 index 0000000..0ae646f --- /dev/null +++ b/.agent/skills/inputsystem-binding-remove/SKILL.md @@ -0,0 +1,141 @@ +--- +name: inputsystem-binding-remove +description: Remove a Binding by its index from an Action in a `.inputactions` asset, then save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Remove Binding + +Remove an `InputBinding` from an `InputAction` by its index within that Action's binding list. Use 'inputsystem-get' to discover binding indices first. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` / `actionName` — required. The Action that owns the binding. +- `bindingIndex` — required. Zero-based index of the binding within the Action. + +## Behavior + +Loads the asset, resolves the Action, erases the binding at the given index (failing if out of range), saves and re-imports the asset. Note: erasing a composite root also affects its parts. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-binding-remove --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value", + "bindingIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap containing the Action. | +| `actionName` | `string` | Yes | Name of the Action that owns the binding. | +| `bindingIndex` | `integer` | Yes | Zero-based index of the binding within the Action's binding list. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + }, + "bindingIndex": { + "type": "integer" + } + }, + "required": [ + "assetPath", + "mapName", + "actionName", + "bindingIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingRemoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingRemoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap." + }, + "actionName": { + "type": "string", + "description": "Name of the Action." + }, + "removedIndex": { + "type": "integer", + "description": "Index of the binding that was removed." + }, + "bindingCount": { + "type": "integer", + "description": "Number of bindings remaining on the Action." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "removedIndex", + "bindingCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-binding-set/SKILL.md b/.agent/skills/inputsystem-binding-set/SKILL.md new file mode 100644 index 0000000..f0031f5 --- /dev/null +++ b/.agent/skills/inputsystem-binding-set/SKILL.md @@ -0,0 +1,176 @@ +--- +name: inputsystem-binding-set +description: Update a Binding's path, groups, interactions and/or processors by index on an Action in a `.inputactions` asset, then save it. Only the supplied fields are changed. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Set Binding + +Update fields of an existing `InputBinding` (identified by its index on an `InputAction`). Only the parameters you provide are applied; the rest are left unchanged. Use 'inputsystem-get' to find the binding index first. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `mapName` / `actionName` — required. The Action that owns the binding. +- `bindingIndex` — required. Zero-based index of the binding. +- `path` — optional new control path. +- `groups` — optional new control-scheme group(s). +- `interactions` — optional new interactions. +- `processors` — optional new processors. + +## Behavior + +Loads the asset, resolves the Action and binding index (failing if out of range), applies each supplied field via the `ChangeBinding` syntax (`WithPath` / `WithGroups` / `WithInteractions` / `WithProcessors`), saves and re-imports the asset. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-binding-set --input '{ + "assetPath": "string_value", + "mapName": "string_value", + "actionName": "string_value", + "bindingIndex": 0, + "path": "string_value", + "groups": "string_value", + "interactions": "string_value", + "processors": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-set --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-binding-set --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `mapName` | `string` | Yes | Name of the ActionMap containing the Action. | +| `actionName` | `string` | Yes | Name of the Action that owns the binding. | +| `bindingIndex` | `integer` | Yes | Zero-based index of the binding to update. | +| `path` | `string` | No | Optional new control path. | +| `groups` | `string` | No | Optional new control-scheme group(s). | +| `interactions` | `string` | No | Optional new interactions. | +| `processors` | `string` | No | Optional new processors. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "mapName": { + "type": "string" + }, + "actionName": { + "type": "string" + }, + "bindingIndex": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "groups": { + "type": "string" + }, + "interactions": { + "type": "string" + }, + "processors": { + "type": "string" + } + }, + "required": [ + "assetPath", + "mapName", + "actionName", + "bindingIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingSetResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingSetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "mapName": { + "type": "string", + "description": "Name of the ActionMap." + }, + "actionName": { + "type": "string", + "description": "Name of the Action." + }, + "bindingIndex": { + "type": "integer", + "description": "Index of the updated binding." + }, + "path": { + "type": "string", + "description": "Resulting control path of the binding." + }, + "groups": { + "type": "string", + "description": "Resulting control-scheme group(s)." + }, + "interactions": { + "type": "string", + "description": "Resulting interactions." + }, + "processors": { + "type": "string", + "description": "Resulting processors." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "bindingIndex", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-controlscheme-add/SKILL.md b/.agent/skills/inputsystem-controlscheme-add/SKILL.md new file mode 100644 index 0000000..3ba1040 --- /dev/null +++ b/.agent/skills/inputsystem-controlscheme-add/SKILL.md @@ -0,0 +1,149 @@ +--- +name: inputsystem-controlscheme-add +description: Add a Control Scheme (with optional required / optional device requirements) to a `.inputactions` asset, then save it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Add Control Scheme + +Add an `InputControlScheme` to an InputActionAsset. A control scheme groups bindings by a set of devices (e.g. a 'Keyboard&Mouse' scheme and a 'Gamepad' scheme), letting the same Actions support multiple input setups. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `schemeName` — required. Unique control-scheme name. +- `requiredDevices` — optional device control paths that MUST be present (e.g. ``). +- `optionalDevices` — optional device control paths that MAY be present (e.g. ``). + +## Behavior + +Loads the asset, adds the control scheme via `AddControlScheme`, registers each required / optional device requirement, saves and re-imports the asset. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-controlscheme-add --input '{ + "assetPath": "string_value", + "schemeName": "string_value", + "requiredDevices": "string_value", + "optionalDevices": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-controlscheme-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-controlscheme-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `schemeName` | `string` | Yes | Unique name of the new control scheme. | +| `requiredDevices` | `any` | No | Optional required device control paths (e.g. ''). All must be present for the scheme to be usable. | +| `optionalDevices` | `any` | No | Optional optional-device control paths (e.g. ''). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "schemeName": { + "type": "string" + }, + "requiredDevices": { + "$ref": "#/$defs/System.String-1" + }, + "optionalDevices": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "assetPath", + "schemeName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ControlSchemeAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ControlSchemeAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "schemeName": { + "type": "string", + "description": "Name of the added control scheme." + }, + "requiredDeviceCount": { + "type": "integer", + "description": "Number of required devices registered." + }, + "optionalDeviceCount": { + "type": "integer", + "description": "Number of optional devices registered." + }, + "controlSchemeCount": { + "type": "integer", + "description": "Total number of control schemes in the asset." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "requiredDeviceCount", + "optionalDeviceCount", + "controlSchemeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-get/SKILL.md b/.agent/skills/inputsystem-get/SKILL.md new file mode 100644 index 0000000..ecb1da8 --- /dev/null +++ b/.agent/skills/inputsystem-get/SKILL.md @@ -0,0 +1,227 @@ +--- +name: inputsystem-get +description: Read the full structure of a `.inputactions` InputActionAsset — its ActionMaps, Actions (type / expectedControlType), Bindings (path / groups / interactions / processors / index) and Control Schemes. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Get Asset Structure + +Inspect an `InputActionAsset` and return its structure so you can discover map names, action names, and binding indices to drive the other tools. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. + +## Behavior + +Loads the asset and walks its ActionMaps → Actions → Bindings plus its Control Schemes, returning a compact structured summary (including each binding's zero-based index, whether it is a composite, and its part metadata). Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-get --input '{ + "assetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-GetResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-MapInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-MapInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-MapInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "ActionMap name." + }, + "actions": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionInfo-1", + "description": "Actions in the map." + } + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ActionInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Action name." + }, + "type": { + "type": "string", + "description": "Action type (Button / Value / PassThrough)." + }, + "expectedControlType": { + "type": "string", + "description": "Expected control type, or null." + }, + "bindings": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingInfo-1", + "description": "Bindings on the action (with their indices)." + } + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-BindingInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Zero-based index of the binding within the action." + }, + "path": { + "type": "string", + "description": "Control path, or empty for a composite root." + }, + "name": { + "type": "string", + "description": "Binding/part name (e.g. composite part 'up'), or empty." + }, + "groups": { + "type": "string", + "description": "Control-scheme group(s)." + }, + "interactions": { + "type": "string", + "description": "Interactions." + }, + "processors": { + "type": "string", + "description": "Processors." + }, + "isComposite": { + "type": "boolean", + "description": "True if this binding is a composite root." + }, + "isPartOfComposite": { + "type": "boolean", + "description": "True if this binding is a part of a composite." + } + }, + "required": [ + "index", + "isComposite", + "isPartOfComposite" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SchemeInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SchemeInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SchemeInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Control scheme name." + }, + "bindingGroup": { + "type": "string", + "description": "Binding group string for the scheme." + }, + "devices": { + "$ref": "#/$defs/System.String-1", + "description": "Device requirements (prefixed '(optional)' when optional)." + } + } + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-GetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the inspected asset." + }, + "actionMaps": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-MapInfo-1", + "description": "ActionMaps in the asset." + }, + "controlSchemes": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SchemeInfo-1", + "description": "Control schemes in the asset." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-modify/SKILL.md b/.agent/skills/inputsystem-modify/SKILL.md new file mode 100644 index 0000000..4dbe0e4 --- /dev/null +++ b/.agent/skills/inputsystem-modify/SKILL.md @@ -0,0 +1,168 @@ +--- +name: inputsystem-modify +description: "Generic write escape-hatch: apply a `SerializedMember` diff to the `InputActionAsset` object itself via ReflectorNet `TryModify`, for fields not covered by the dedicated tools. Use 'inputsystem-get' first to inspect the structure." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Modify Asset (generic) + +Modify an `InputActionAsset` by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for asset-level fields/properties that the dedicated tools do not expose. + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. +- `data` — the `SerializedMember` diff to apply. Route **fields** through the `fields` channel and **properties** through the `props` channel — ReflectorNet resolves them separately with no cross-fallback. + +## Behavior + +Loads the asset, applies the diff via `Reflector.TryModify`, and on success re-serializes and saves the asset back to disk. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-modify --input '{ + "assetPath": "string_value", + "data": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Fields go through the 'fields' channel; properties through 'props'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "assetPath", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ModifyResponse" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-ModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "assetPath": { + "type": "string", + "description": "Path of the modified asset." + }, + "assetType": { + "type": "string", + "description": "Full type name of the modified asset." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/inputsystem-save/SKILL.md b/.agent/skills/inputsystem-save/SKILL.md new file mode 100644 index 0000000..ebf14df --- /dev/null +++ b/.agent/skills/inputsystem-save/SKILL.md @@ -0,0 +1,113 @@ +--- +name: inputsystem-save +description: Re-serialize a `.inputactions` InputActionAsset to disk and re-import it. Useful to force-persist an asset after external edits. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# InputSystem / Save Asset + +Persist an `InputActionAsset` to its `.inputactions` file. The mutation tools save automatically; this tool is an explicit save for cases where the on-disk JSON should be regenerated (e.g. after edits made outside these tools). + +## Inputs + +- `assetPath` — required. Path to the existing `.inputactions` asset. + +## Behavior + +Loads the asset, re-serializes it to JSON via `ToJson()`, writes the file, and re-imports it into the AssetDatabase. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool inputsystem-save --input '{ + "assetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool inputsystem-save --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool inputsystem-save --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | 'Assets/'-rooted path to the existing '.inputactions' asset. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SaveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_InputSystem-SaveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the saved asset." + }, + "actionMapCount": { + "type": "integer", + "description": "Number of ActionMaps in the saved asset." + }, + "controlSchemeCount": { + "type": "integer", + "description": "Number of control schemes in the saved asset." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "actionMapCount", + "controlSchemeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-agent-add/SKILL.md b/.agent/skills/navigation-agent-add/SKILL.md new file mode 100644 index 0000000..11d787f --- /dev/null +++ b/.agent/skills/navigation-agent-add/SKILL.md @@ -0,0 +1,284 @@ +--- +name: navigation-agent-add +description: Add and configure a `NavMeshAgent` (from the built-in `com.unity.modules.ai`) on a GameObject — or create a new GameObject to host it. Configure agent type, speed, acceleration, angular speed, stopping distance, and the area mask. Returns the GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshAgent + +Add a `NavMeshAgent` to a GameObject so it can pathfind across a baked NavMesh. Use 'navigation-agent-set-destination' to move it. + +## Inputs + +- `gameObjectRef` — optional GameObject to add the agent to. When omitted, a new GameObject is created. +- `name` — optional name for the new GameObject (default `NavMeshAgent`); ignored when `gameObjectRef` is given. +- `agentTypeId` — optional NavMesh agent-type id (default 0 = Humanoid). +- `speed` — optional max movement speed (default 3.5). +- `acceleration` — optional max acceleration (default 8). +- `angularSpeed` — optional max turning speed in deg/s (default 120). +- `stoppingDistance` — optional stop distance from the destination (default 0). +- `areaMask` — optional traversable-area bitmask (default -1 = all areas). + +## Behavior + +Adds (or reuses) a `NavMeshAgent`, assigns the configured properties, marks the scene dirty, repaints, and returns the GameObject reference, the agent component reference, and the instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-agent-add --input '{ + "gameObjectRef": "string_value", + "name": "string_value", + "agentTypeId": 0, + "speed": 0, + "acceleration": 0, + "angularSpeed": 0, + "stoppingDistance": 0, + "areaMask": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-agent-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-agent-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | No | Optional GameObject to add the NavMeshAgent to. When omitted, a new GameObject is created. | +| `name` | `string` | No | Name for the new GameObject (ignored when gameObjectRef is provided). | +| `agentTypeId` | `integer` | No | NavMesh agent-type id (0 = Humanoid by default). | +| `speed` | `number` | No | Maximum movement speed. | +| `acceleration` | `number` | No | Maximum acceleration. | +| `angularSpeed` | `number` | No | Maximum turning speed in degrees per second. | +| `stoppingDistance` | `number` | No | Distance from the destination at which the agent stops. | +| `areaMask` | `integer` | No | Traversable-area bitmask (-1 = all areas). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "name": { + "type": "string" + }, + "agentTypeId": { + "type": "integer" + }, + "speed": { + "type": "number" + }, + "acceleration": { + "type": "number" + }, + "angularSpeed": { + "type": "number" + }, + "stoppingDistance": { + "type": "number" + }, + "areaMask": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshAgent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the GameObject hosting the agent." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Resolved agent-type id." + }, + "speed": { + "type": "number", + "description": "Resolved speed." + }, + "acceleration": { + "type": "number", + "description": "Resolved acceleration." + }, + "stoppingDistance": { + "type": "number", + "description": "Resolved stopping distance." + }, + "areaMask": { + "type": "integer", + "description": "Resolved area mask." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "agentTypeId", + "speed", + "acceleration", + "stoppingDistance", + "areaMask", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-agent-set-destination/SKILL.md b/.agent/skills/navigation-agent-set-destination/SKILL.md new file mode 100644 index 0000000..b3737fd --- /dev/null +++ b/.agent/skills/navigation-agent-set-destination/SKILL.md @@ -0,0 +1,288 @@ +--- +name: navigation-agent-set-destination +description: Set the destination of a `NavMeshAgent` so it pathfinds toward a world-space point. Optionally provide a target GameObject instead of explicit coordinates. The agent must be on a baked NavMesh for a path to be computed (most relevant in play mode). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Set Agent Destination + +Set a `NavMeshAgent`'s destination. The agent computes a path across the baked NavMesh and begins moving toward the destination (path computation/movement happens in play mode; in edit mode the destination is still assigned). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `NavMeshAgent` (required). +- `destination` — the world-space destination point. Ignored when `targetRef` is provided. +- `targetRef` — optional GameObject whose position is used as the destination. + +## Behavior + +Resolves the agent, computes the destination (from `targetRef` if given, else `destination`), and — when the agent is active and placed on a NavMesh — calls `SetDestination`. Off the NavMesh (e.g. before baking, in edit mode) it reports the intended destination without mutating, so the call is always safe. Returns `accepted` plus the agent's `hasPath` / `pathPending` state. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-agent-set-destination --input '{ + "gameObjectRef": "string_value", + "destination": "string_value", + "targetRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-agent-set-destination --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-agent-set-destination --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMeshAgent component. | +| `destination` | `any` | No | World-space destination point (ignored when targetRef is provided). | +| `targetRef` | `any` | No | Optional GameObject whose position is used as the destination. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "destination": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "targetRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentSetDestinationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentSetDestinationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshAgent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "destination": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "The resolved destination point." + }, + "accepted": { + "type": "boolean", + "description": "Whether SetDestination accepted the request (false if the agent is off the NavMesh)." + }, + "isOnNavMesh": { + "type": "boolean", + "description": "Whether the agent is currently on a baked NavMesh." + }, + "hasPath": { + "type": "boolean", + "description": "Whether the agent has a computed path." + }, + "pathPending": { + "type": "boolean", + "description": "Whether a path is still being computed." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "destination", + "accepted", + "isOnNavMesh", + "hasPath", + "pathPending", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-get/SKILL.md b/.agent/skills/navigation-get/SKILL.md new file mode 100644 index 0000000..951a8ca --- /dev/null +++ b/.agent/skills/navigation-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: navigation-get +description: "Generic read: serialize any NavMesh `Component` (NavMeshSurface / NavMeshModifier / NavMeshModifierVolume / NavMeshLink / NavMeshAgent) on a GameObject via ReflectorNet. Pair with 'navigation-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Get Component + +Serialize any NavMesh component on a GameObject using ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one NavMesh component; otherwise the first recognized NavMesh component is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target NavMesh component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMesh component. | +| `componentRef` | `any` | No | Optional reference to a specific NavMesh component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-link-add/SKILL.md b/.agent/skills/navigation-link-add/SKILL.md new file mode 100644 index 0000000..e4c6014 --- /dev/null +++ b/.agent/skills/navigation-link-add/SKILL.md @@ -0,0 +1,312 @@ +--- +name: navigation-link-add +description: Add and configure a `NavMeshLink` on a GameObject. A NavMeshLink connects two points on (or off) the NavMesh — e.g. a jump-across or a doorway — so agents can traverse gaps the baked mesh does not cover. Points are local to the GameObject's transform. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshLink + +Add a `NavMeshLink` to a GameObject. The link bridges `startPoint` and `endPoint` (in the GameObject's local space), letting agents cross between otherwise-disconnected NavMesh regions. + +## Inputs + +- `gameObjectRef` — the GameObject to add the link to (required). +- `startPoint` — local-space start of the link (default 0,0,-2.5). +- `endPoint` — local-space end of the link (default 0,0,2.5). +- `width` — link width in meters (default 0). +- `bidirectional` — when `true`, the link is traversable both ways (default true). +- `costModifier` — cost override; negative means use the default cost (default -1). +- `area` — NavMesh area index of the link (default 2 = Jump). + +## Behavior + +Adds (or reuses) a `NavMeshLink`, assigns the configured fields (which auto-rebuild the link), marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-link-add --input '{ + "gameObjectRef": "string_value", + "startPoint": "string_value", + "endPoint": "string_value", + "width": 0, + "bidirectional": false, + "costModifier": 0, + "area": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-link-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-link-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshLink to. | +| `startPoint` | `any` | No | Local-space start point of the link. | +| `endPoint` | `any` | No | Local-space end point of the link. | +| `width` | `number` | No | Link width in meters. | +| `bidirectional` | `boolean` | No | If true, the link is traversable in both directions. | +| `costModifier` | `integer` | No | Cost modifier for traversing the link; negative uses the default cost. | +| `area` | `integer` | No | NavMesh area index of the link (2 = Jump by default). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "startPoint": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "endPoint": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "width": { + "type": "number" + }, + "bidirectional": { + "type": "boolean" + }, + "costModifier": { + "type": "integer" + }, + "area": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-LinkAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-LinkAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the link." + }, + "linkRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshLink component." + }, + "startPoint": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved local start point." + }, + "endPoint": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved local end point." + }, + "width": { + "type": "number", + "description": "Resolved width." + }, + "bidirectional": { + "type": "boolean", + "description": "Resolved bidirectional flag." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "startPoint", + "endPoint", + "width", + "bidirectional", + "area", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-list/SKILL.md b/.agent/skills/navigation-list/SKILL.md new file mode 100644 index 0000000..c1ad29f --- /dev/null +++ b/.agent/skills/navigation-list/SKILL.md @@ -0,0 +1,246 @@ +--- +name: navigation-list +description: List every `NavMeshSurface` and `NavMeshAgent` in the active scene with their key settings (agent type, baked-data presence for surfaces; speed, on-NavMesh state for agents). Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / List Surfaces and Agents + +Enumerate the NavMesh components in the active scene so you can inspect what is set up. + +## Inputs + +- `includeInactive` (bool, default true) — include components on inactive/disabled GameObjects. + +## Behavior + +Finds all `NavMeshSurface` and `NavMeshAgent` instances, reports each surface's agent-type id and whether it has baked NavMeshData, and each agent's agent-type id, speed, and whether it is currently on a NavMesh. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include components on inactive/disabled GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the surface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "name": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Agent-type id this surface bakes for." + }, + "hasNavMeshData": { + "type": "boolean", + "description": "Whether the surface has baked NavMeshData." + } + }, + "required": [ + "agentTypeId", + "hasNavMeshData" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the agent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "name": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Agent-type id of the agent." + }, + "speed": { + "type": "number", + "description": "Movement speed of the agent." + }, + "isOnNavMesh": { + "type": "boolean", + "description": "Whether the agent is currently on a baked NavMesh." + } + }, + "required": [ + "agentTypeId", + "speed", + "isOnNavMesh" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationListResponse": { + "type": "object", + "properties": { + "surfaceCount": { + "type": "integer", + "description": "Number of NavMeshSurfaces found." + }, + "agentCount": { + "type": "integer", + "description": "Number of NavMeshAgents found." + }, + "surfaces": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem-1", + "description": "The NavMeshSurfaces in the active scene." + }, + "agents": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem-1", + "description": "The NavMeshAgents in the active scene." + } + }, + "required": [ + "surfaceCount", + "agentCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-modifier-add/SKILL.md b/.agent/skills/navigation-modifier-add/SKILL.md new file mode 100644 index 0000000..c8be997 --- /dev/null +++ b/.agent/skills/navigation-modifier-add/SKILL.md @@ -0,0 +1,255 @@ +--- +name: navigation-modifier-add +description: Add and configure a `NavMeshModifier` on a GameObject. A NavMeshModifier overrides how that object (and optionally its children) is treated during baking — its NavMesh area, whether it is ignored, and link generation. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshModifier + +Add a `NavMeshModifier` to a GameObject so its geometry is baked with overridden parameters. + +## Inputs + +- `gameObjectRef` — the GameObject to add the modifier to (required). +- `overrideArea` — when `true`, the object's NavMesh area is overridden with `area`. +- `area` — the NavMesh area index to assign when `overrideArea` is true (default 0 = Walkable). +- `ignoreFromBuild` — when `true`, the object is excluded from the bake entirely. +- `applyToChildren` — when `true`, the override also applies to child objects. + +## Behavior + +Adds (or reuses) a `NavMeshModifier`, assigns the configured flags, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modifier-add --input '{ + "gameObjectRef": "string_value", + "overrideArea": false, + "area": 0, + "ignoreFromBuild": false, + "applyToChildren": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modifier-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modifier-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshModifier to. | +| `overrideArea` | `boolean` | No | If true, override the NavMesh area of this object with 'area'. | +| `area` | `integer` | No | NavMesh area index to assign when overrideArea is true (0 = Walkable). | +| `ignoreFromBuild` | `boolean` | No | If true, exclude this object from the NavMesh bake. | +| `applyToChildren` | `boolean` | No | If true, apply the override to child objects as well. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "overrideArea": { + "type": "boolean" + }, + "area": { + "type": "integer" + }, + "ignoreFromBuild": { + "type": "boolean" + }, + "applyToChildren": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the modifier." + }, + "modifierRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshModifier component." + }, + "overrideArea": { + "type": "boolean", + "description": "Resolved overrideArea flag." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "ignoreFromBuild": { + "type": "boolean", + "description": "Resolved ignoreFromBuild flag." + }, + "applyToChildren": { + "type": "boolean", + "description": "Resolved applyToChildren flag." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "overrideArea", + "area", + "ignoreFromBuild", + "applyToChildren", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-modifier-volume-add/SKILL.md b/.agent/skills/navigation-modifier-volume-add/SKILL.md new file mode 100644 index 0000000..339c48d --- /dev/null +++ b/.agent/skills/navigation-modifier-volume-add/SKILL.md @@ -0,0 +1,284 @@ +--- +name: navigation-modifier-volume-add +description: Add and configure a `NavMeshModifierVolume` on a GameObject. A modifier volume marks a box-shaped region of space so that any NavMesh baked inside it is assigned a specific area (e.g. a non-walkable or higher-cost zone). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshModifierVolume + +Add a `NavMeshModifierVolume` to a GameObject. Unlike a NavMeshModifier (which is tied to geometry), a volume affects whatever NavMesh is generated inside its box region. + +## Inputs + +- `gameObjectRef` — the GameObject to add the volume to (required). +- `size` — the box size of the volume (default 4,4,4). +- `center` — the box center offset (default 0,0,0). +- `area` — the NavMesh area index assigned inside the volume (default 0 = Walkable). + +## Behavior + +Adds (or reuses) a `NavMeshModifierVolume`, assigns size / center / area, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modifier-volume-add --input '{ + "gameObjectRef": "string_value", + "size": "string_value", + "center": "string_value", + "area": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modifier-volume-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modifier-volume-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshModifierVolume to. | +| `size` | `any` | No | Box size of the volume. | +| `center` | `any` | No | Box center offset of the volume. | +| `area` | `integer` | No | NavMesh area index assigned inside the volume (0 = Walkable). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "area": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierVolumeAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierVolumeAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the volume." + }, + "volumeRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshModifierVolume component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved box size." + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved box center." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "size", + "center", + "area", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-modify/SKILL.md b/.agent/skills/navigation-modify/SKILL.md new file mode 100644 index 0000000..e1f58ab --- /dev/null +++ b/.agent/skills/navigation-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: navigation-modify +description: "Generic write: apply a `SerializedMember` diff to any NavMesh `Component` on a GameObject via ReflectorNet `TryModify`. Use 'navigation-get' first to inspect the structure so the diff is targeted. Remember: fields go through the `fields` channel, properties through `props`." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Modify Component + +Modify any NavMesh component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Include only the members you want to change. C# fields must be supplied through the `fields` channel and properties through `props` (no cross-fallback). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one NavMesh component; otherwise the first recognized NavMesh component is used. + +## Behavior + +Finds the target NavMesh component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMesh component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific NavMesh component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-set-bake-settings/SKILL.md b/.agent/skills/navigation-set-bake-settings/SKILL.md new file mode 100644 index 0000000..5e5d552 --- /dev/null +++ b/.agent/skills/navigation-set-bake-settings/SKILL.md @@ -0,0 +1,249 @@ +--- +name: navigation-set-bake-settings +description: Tune NavMesh bake settings. Agent radius / height / max-slope / step-height belong to a NavMesh agent type (in project NavMesh settings) and apply to every surface baking for that type. The voxel size is a per-surface override; pass `gameObjectRef` (a NavMeshSurface) with `voxelSize` to set it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Set Bake Settings + +Configure the parameters that control how a NavMesh is voxelized and baked. + +Agent radius / height / max-slope / step-height are stored on the **agent type** (id `agentTypeId`, default 0 = Humanoid) in the project's NavMesh settings, so they affect all surfaces baking for that type. The **voxel size** is a per-`NavMeshSurface` override. + +## Inputs + +- `agentTypeId` — the NavMesh agent type to edit (default 0 = Humanoid). +- `agentRadius` — optional agent radius (meters). +- `agentHeight` — optional agent height (meters). +- `maxSlope` — optional maximum walkable slope (degrees, 0–60). +- `stepHeight` — optional maximum step / climb height (meters). +- `gameObjectRef` — optional NavMeshSurface GameObject whose voxel-size override to set. +- `voxelSize` — optional voxel size for that surface (only applied when `gameObjectRef` is provided; sets `overrideVoxelSize = true`). + +## Behavior + +Edits the agent type's bake settings via the `NavMeshProjectSettings` serialized object (only the provided values change), and optionally enables and sets the surface voxel-size override. Marks dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-set-bake-settings --input '{ + "agentTypeId": 0, + "agentRadius": "string_value", + "agentHeight": "string_value", + "maxSlope": "string_value", + "stepHeight": "string_value", + "gameObjectRef": "string_value", + "voxelSize": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-set-bake-settings --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-set-bake-settings --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `agentTypeId` | `integer` | No | NavMesh agent-type id to edit (0 = Humanoid by default). | +| `agentRadius` | `any` | No | Agent radius in meters. | +| `agentHeight` | `any` | No | Agent height in meters. | +| `maxSlope` | `any` | No | Maximum walkable slope in degrees (0-60). | +| `stepHeight` | `any` | No | Maximum step / climb height in meters. | +| `gameObjectRef` | `any` | No | Optional NavMeshSurface GameObject whose voxel-size override to set. | +| `voxelSize` | `any` | No | Voxel size for the surface (applied only when gameObjectRef is provided). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "agentTypeId": { + "type": "integer" + }, + "agentRadius": { + "$ref": "#/$defs/System.Single" + }, + "agentHeight": { + "$ref": "#/$defs/System.Single" + }, + "maxSlope": { + "$ref": "#/$defs/System.Single" + }, + "stepHeight": { + "$ref": "#/$defs/System.Single" + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "voxelSize": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "System.Single": { + "type": "number" + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SetBakeSettingsResponse" + } + }, + "$defs": { + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SetBakeSettingsResponse": { + "type": "object", + "properties": { + "agentTypeId": { + "type": "integer", + "description": "The edited agent-type id." + }, + "agentSettingsApplied": { + "type": "boolean", + "description": "Whether agent-type bake settings were applied." + }, + "agentRadius": { + "type": "number", + "description": "Resolved agent radius after the edit." + }, + "agentHeight": { + "type": "number", + "description": "Resolved agent height after the edit." + }, + "maxSlope": { + "type": "number", + "description": "Resolved maximum slope after the edit." + }, + "stepHeight": { + "type": "number", + "description": "Resolved step / climb height after the edit." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the surface whose voxel size was set, if any." + }, + "voxelSizeApplied": { + "type": "boolean", + "description": "Whether the surface voxel size override was applied." + }, + "voxelSize": { + "type": "number", + "description": "Resolved voxel size for the surface, if set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "agentTypeId", + "agentSettingsApplied", + "agentRadius", + "agentHeight", + "maxSlope", + "stepHeight", + "voxelSizeApplied", + "voxelSize", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-surface-add/SKILL.md b/.agent/skills/navigation-surface-add/SKILL.md new file mode 100644 index 0000000..0723689 --- /dev/null +++ b/.agent/skills/navigation-surface-add/SKILL.md @@ -0,0 +1,294 @@ +--- +name: navigation-surface-add +description: Add and configure a `NavMeshSurface` component (from `com.unity.ai.navigation`) on a GameObject — or create a new GameObject to host it. Configure agent type, geometry-collection mode, layer mask, default area, and the box volume (size/center). Returns the GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshSurface + +Add a `NavMeshSurface` to a GameObject. A NavMeshSurface defines a region of the scene that is baked into a runtime NavMesh that agents can traverse. Use 'navigation-set-bake-settings' to tune the agent radius/height/slope/step and voxel size, then 'navigation-surface-bake' to bake. + +## Inputs + +- `gameObjectRef` — optional GameObject to add the surface to. When omitted, a new GameObject is created. +- `name` — optional name for the new GameObject (default `NavMesh Surface`); ignored when `gameObjectRef` is given. +- `agentTypeId` — optional NavMesh agent-type id this surface bakes for (default 0 = Humanoid). +- `collectObjects` — optional geometry collection mode: `0` All, `1` Volume, `2` Children (default 0 All). +- `defaultArea` — optional default NavMesh area index applied to collected geometry (default 0 = Walkable). +- `layerMask` — optional include-layers bitmask for geometry collection (default -1 = Everything). +- `size` — optional box volume size (only used when `collectObjects` = Volume). +- `center` — optional box volume center offset. + +## Behavior + +Adds (or reuses) a `NavMeshSurface`, assigns the configured properties, marks the scene dirty, repaints, and returns the GameObject reference, the surface component reference, and the instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-surface-add --input '{ + "gameObjectRef": "string_value", + "name": "string_value", + "agentTypeId": 0, + "collectObjects": 0, + "defaultArea": 0, + "layerMask": 0, + "size": "string_value", + "center": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-surface-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-surface-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | No | Optional GameObject to add the NavMeshSurface to. When omitted, a new GameObject is created. | +| `name` | `string` | No | Name for the new GameObject (ignored when gameObjectRef is provided). | +| `agentTypeId` | `integer` | No | NavMesh agent-type id this surface bakes for (0 = Humanoid by default). | +| `collectObjects` | `integer` | No | Geometry collection mode: 0 = All, 1 = Volume, 2 = Children. | +| `defaultArea` | `integer` | No | Default NavMesh area index applied to collected geometry (0 = Walkable). | +| `layerMask` | `integer` | No | Include-layers bitmask for geometry collection (-1 = Everything). | +| `size` | `any` | No | Box volume size (used only when collectObjects = Volume). | +| `center` | `any` | No | Box volume center offset. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "name": { + "type": "string" + }, + "agentTypeId": { + "type": "integer" + }, + "collectObjects": { + "type": "integer" + }, + "defaultArea": { + "type": "integer" + }, + "layerMask": { + "type": "integer" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshSurface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the GameObject hosting the surface." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Resolved agent-type id." + }, + "collectObjects": { + "type": "integer", + "description": "Resolved geometry collection mode." + }, + "defaultArea": { + "type": "integer", + "description": "Resolved default area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "agentTypeId", + "collectObjects", + "defaultArea", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/navigation-surface-bake/SKILL.md b/.agent/skills/navigation-surface-bake/SKILL.md new file mode 100644 index 0000000..286a40f --- /dev/null +++ b/.agent/skills/navigation-surface-bake/SKILL.md @@ -0,0 +1,227 @@ +--- +name: navigation-surface-bake +description: Bake (build) the NavMesh for a `NavMeshSurface`, or clear its existing baked data. Pass `clear = true` to remove the baked NavMeshData instead of building it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Bake or Clear NavMeshSurface + +Build or clear the runtime NavMesh for a `NavMeshSurface`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `NavMeshSurface` (required). +- `clear` — when `true`, removes the surface's baked NavMeshData (`RemoveData`) instead of baking. Default `false` (bake via `BuildNavMesh`). + +## Behavior + +When baking, collects the surface's geometry sources and builds the NavMeshData, then marks the surface dirty so the result is saved. When clearing, removes the active NavMeshData from the surface. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-surface-bake --input '{ + "gameObjectRef": "string_value", + "clear": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-surface-bake --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-surface-bake --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMeshSurface component. | +| `clear` | `boolean` | No | If true, clears the baked NavMeshData instead of baking it. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clear": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceBakeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceBakeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshSurface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "cleared": { + "type": "boolean", + "description": "Whether the surface was cleared (true) or baked (false)." + }, + "hasNavMeshData": { + "type": "boolean", + "description": "Whether the surface has baked NavMeshData after the operation." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cleared", + "hasNavMeshData", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/object-get-data/SKILL.md b/.agent/skills/object-get-data/SKILL.md new file mode 100644 index 0000000..f5cd134 --- /dev/null +++ b/.agent/skills/object-get-data/SKILL.md @@ -0,0 +1,188 @@ +--- +name: object-get-data +description: Get serialized data for a Unity `UnityEngine.Object` — all serializable fields and properties. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Pair with 'object-modify' when you need to write back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Object / Get Data + +Get data of the specified Unity Object. Returns serialized data of the object including its properties and fields. If need to modify the data use 'object-modify' tool. + +## Path-scoped reads (token-saving) + +Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. These two parameters are mutually exclusive — supply at most one. When neither is supplied the full object is serialized (backwards compatible). + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool object-get-data --input '{ + "objectRef": "string_value", + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool object-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool object-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `objectRef` | `any` | Yes | Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object. | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. Each path may target a different depth. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View — combines a starting Path, a case-insensitive NamePattern regex, MaxDepth, and an optional TypeFilter. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "objectRef": { + "$ref": "#/$defs/AIGD.ObjectRef" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + }, + "required": [ + "objectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/object-modify/SKILL.md b/.agent/skills/object-modify/SKILL.md new file mode 100644 index 0000000..728f5c0 --- /dev/null +++ b/.agent/skills/object-modify/SKILL.md @@ -0,0 +1,287 @@ +--- +name: object-modify +description: Modify a Unity `UnityEngine.Object`'s serializable fields/properties. Three modification surfaces are available (`objectDiff`, `pathPatches`, `jsonPatch`) — see the skill body. Use 'object-get-data' first to inspect the object structure. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Object / Modify + +Modify the specified Unity Object. Allows direct modification of object fields and properties. Use 'object-get-data' first to inspect the object structure before modifying. + +## Three modification surfaces + +Use whichever fits the task: + +1. `objectDiff` — full `SerializedMember` diff (legacy, backwards compatible). +2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`; atomic per-path modification, multiple entries can target different depths. +3. `jsonPatch` — a JSON Merge Patch (RFC 7396, extended with `[i]`/`[key]` notation) routed through `Reflector.TryPatch`; multiple fields at any depth in a single call. + +When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `objectDiff`. At least one is required. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. + +## How to Call + +```bash +unity-mcp-cli run-tool object-modify --input '{ + "objectRef": "string_value", + "objectDiff": "string_value", + "pathPatches": "string_value", + "jsonPatch": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool object-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool object-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `objectRef` | `any` | Yes | Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object. | +| `objectDiff` | `any` | No | Optional. The full object data to apply (legacy path). Should contain 'fields' and/or 'props' with the values to modify. +Only include the fields/properties you want to change. +Any unknown or invalid fields and properties will be reported in the response. | +| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. | +| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "objectRef": { + "$ref": "#/$defs/AIGD.ObjectRef" + }, + "objectDiff": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "pathPatches": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)" + }, + "jsonPatch": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": true + } + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.PathPatch": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required." + }, + "Value": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember." + } + } + }, + "System.Collections.Generic.List(AIGD.PathPatch)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PathPatch" + } + } + }, + "required": [ + "objectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ModifyObjectResponse" + } + }, + "$defs": { + "AIGD.ObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "AIGD.ModifyObjectResponse": { + "type": "object", + "properties": { + "Success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "Reference": { + "$ref": "#/$defs/AIGD.ObjectRef", + "description": "Reference to the modified object." + }, + "Data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Updated object data after modification." + }, + "Logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications made and any warnings/errors encountered." + } + }, + "required": [ + "Success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/package-add/SKILL.md b/.agent/skills/package-add/SKILL.md new file mode 100644 index 0000000..c889a8a --- /dev/null +++ b/.agent/skills/package-add/SKILL.md @@ -0,0 +1,75 @@ +--- +name: package-add +description: Install a Unity package from the registry, a Git URL, or a local path. Modifies `manifest.json` and triggers package resolution; may also trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Use 'package-search' / 'package-list' for discovery first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Package Manager / Add + +Install a package from the Unity Package Manager registry, Git URL, or local path. This operation modifies the project's manifest.json and triggers package resolution. Note: Package installation may trigger a domain reload. The result will be sent after the reload completes. Use 'package-search' tool to search for packages and 'package-list' to list installed packages. + +## `packageId` formats + +- Plain package ID: `com.unity.textmeshpro` (installs latest compatible version). +- Pinned version: `com.unity.textmeshpro@3.0.6`. +- Git URL: `https://github.com/user/repo.git`. +- Git URL with branch/tag: `https://github.com/user/repo.git#v1.0.0`. +- Local path: `file:../MyPackage`. + +## Processing model + +Returns `Processing` immediately with the supplied `requestId`. Once `Client.Add` completes, a follow-up result is delivered: success → `SchedulePostDomainReloadNotification` (delivers after the reload finishes), failure → an immediate error notification with the underlying Unity error message. + +## How to Call + +```bash +unity-mcp-cli run-tool package-add --input '{ + "packageId": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool package-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool package-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `packageId` | `string` | Yes | The package ID to install. Formats: Package ID 'com.unity.textmeshpro' (installs latest compatible version), Package ID with version 'com.unity.textmeshpro@3.0.6', Git URL 'https://github.com/user/repo.git', Git URL with branch/tag 'https://github.com/user/repo.git#v1.0.0', Local path 'file:../MyPackage'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "packageId": { + "type": "string" + } + }, + "required": [ + "packageId" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/package-list/SKILL.md b/.agent/skills/package-list/SKILL.md new file mode 100644 index 0000000..9a6cd9e --- /dev/null +++ b/.agent/skills/package-list/SKILL.md @@ -0,0 +1,138 @@ +--- +name: package-list +description: List all UPM packages installed in the Unity project — name, version, source, description. Optionally filter by source (registry, embedded, local, git, built-in, local tarball), by name/display/description substring, and by direct-dependency-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Package Manager / List Installed + +List all packages installed in the Unity project (UPM packages). Returns information about each installed package including name, version, source, and description. Use this to check which packages are currently installed before adding or removing packages. + +## Inputs + +- `sourceFilter` (default `All`) — restrict by Unity `PackageSource`: `All`, `Registry`, `Embedded`, `Local`, `Git`, `BuiltIn`, `LocalTarball`. +- `nameFilter` (optional) — case-insensitive substring filter over name / displayName / description. Results are prioritized: exact name → exact displayName → name substring → displayName substring → description substring. +- `directDependenciesOnly` (default `false`) — when true, return only packages listed in `manifest.json` (no transitive dependencies). + +## How to Call + +```bash +unity-mcp-cli run-tool package-list --input '{ + "sourceFilter": "string_value", + "nameFilter": "string_value", + "directDependenciesOnly": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool package-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool package-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sourceFilter` | `string` | No | Filter packages by source. | +| `nameFilter` | `string` | No | Filter packages by name, display name, or description (case-insensitive). Results are prioritized: exact name match, exact display name match, name substring, display name substring, description substring. | +| `directDependenciesOnly` | `boolean` | No | Include only direct dependencies (packages in manifest.json). If false, includes all resolved packages. Default: false | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sourceFilter": { + "type": "string", + "enum": [ + "All", + "Registry", + "Embedded", + "Local", + "Git", + "BuiltIn", + "LocalTarball" + ] + }, + "nameFilter": { + "type": "string" + }, + "directDependenciesOnly": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PackageData)" + } + }, + "$defs": { + "AIGD.PackageData": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The official Unity name of the package used as the package ID." + }, + "DisplayName": { + "type": "string", + "description": "The display name of the package." + }, + "Version": { + "type": "string", + "description": "The version of the package." + }, + "Description": { + "type": "string", + "description": "A brief description of the package." + }, + "Source": { + "type": "string", + "description": "The source of the package (Registry, Embedded, Local, Git, etc.)." + }, + "Category": { + "type": "string", + "description": "The category of the package." + } + }, + "description": "Package information returned from package list operation." + }, + "System.Collections.Generic.List(AIGD.PackageData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PackageData", + "description": "Package information returned from package list operation." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/package-remove/SKILL.md b/.agent/skills/package-remove/SKILL.md new file mode 100644 index 0000000..65faa3a --- /dev/null +++ b/.agent/skills/package-remove/SKILL.md @@ -0,0 +1,71 @@ +--- +name: package-remove +description: Uninstall a UPM package from the Unity project. Modifies `manifest.json` and may trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Built-in packages and packages that are dependencies of others cannot be removed. Use 'package-list' to list installed packages first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Package Manager / Remove + +Remove (uninstall) a package from the Unity project. This removes the package from the project's manifest.json and triggers package resolution. Note: Built-in packages and packages that are dependencies of other installed packages cannot be removed. Note: Package removal may trigger a domain reload. The result will be sent after the reload completes. Use 'package-list' tool to list installed packages first. + +## Inputs + +- `packageId` — package name (e.g. `com.unity.textmeshpro`). A trailing `@` is stripped automatically before being passed to `Client.Remove`, so accidental versioned IDs still work. + +## Behavior + +First verifies the package is installed via an offline `Client.List` — returns a clear `PackageNotFound` error if not. On removal failure, surfaces Unity's error message. On success, schedules a post-domain-reload notification so the response is delivered after Unity finishes the resolution. + +## How to Call + +```bash +unity-mcp-cli run-tool package-remove --input '{ + "packageId": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool package-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool package-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `packageId` | `string` | Yes | The ID of the package to remove. Example: 'com.unity.textmeshpro'. Do not include version number. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "packageId": { + "type": "string" + } + }, + "required": [ + "packageId" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/package-search/SKILL.md b/.agent/skills/package-search/SKILL.md new file mode 100644 index 0000000..0b040dc --- /dev/null +++ b/.agent/skills/package-search/SKILL.md @@ -0,0 +1,149 @@ +--- +name: package-search +description: Search Unity's package registry plus locally installed packages (Git, local, embedded sources) by query string. Returns available versions and installation status. Online mode fetches exact matches from the live registry then supplements with cached substring matches. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Package Manager / Search + +Search for packages in both Unity Package Manager registry and installed packages. Use this to find packages by name before installing them. Returns available versions and installation status. Searches both the Unity registry and locally installed packages (including Git, local, and embedded sources). Results are prioritized: exact name match, exact display name match, name substring, display name substring, description substring. Note: Online mode fetches exact matches from live registry, then supplements with cached substring matches. + +## Inputs + +- `query` — package id, name, display name, or description keyword (case-insensitive). Required. +- `maxResults` (default 10) — caps the returned list. +- `offlineMode` (default `true`) — when `false`, hits the live registry for exact matches; cached registry data still backs the substring matches in both modes. + +## Result composition + +Each entry includes name, display name, latest version, truncated description, install status, installed version (if any), and the top-5 compatible versions. + +## How to Call + +```bash +unity-mcp-cli run-tool package-search --input '{ + "query": "string_value", + "maxResults": 0, + "offlineMode": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool package-search --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool package-search --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `query` | `string` | Yes | The package id, name, or description. Can be: Full package id 'com.unity.textmeshpro', Full package name 'TextMesh Pro', Partial name 'TextMesh' (will search in Unity registry and installed packages), Description keyword 'rendering' (searches in package descriptions). | +| `maxResults` | `integer` | No | Maximum number of results to return. Default: 10 | +| `offlineMode` | `boolean` | No | Whether to perform the search in offline mode (uses cached registry data only). Default: true. Set to false to fetch latest exact matches from Unity registry. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "maxResults": { + "type": "integer" + }, + "offlineMode": { + "type": "boolean" + } + }, + "required": [ + "query" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.PackageSearchResult)" + } + }, + "$defs": { + "AIGD.PackageSearchResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "The official Unity name of the package used as the package ID." + }, + "DisplayName": { + "type": "string", + "description": "The display name of the package." + }, + "LatestVersion": { + "type": "string", + "description": "The latest version available in the registry." + }, + "Description": { + "type": "string", + "description": "A brief description of the package." + }, + "IsInstalled": { + "type": "boolean", + "description": "Whether this package is already installed in the project." + }, + "InstalledVersion": { + "type": "string", + "description": "The currently installed version (if installed)." + }, + "AvailableVersions": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "Available versions of this package (up to 5 most recent)." + } + }, + "required": [ + "IsInstalled" + ], + "description": "Package search result with available versions." + }, + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "System.Collections.Generic.List(AIGD.PackageSearchResult)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.PackageSearchResult", + "description": "Package search result with available versions." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/particle-system-get/SKILL.md b/.agent/skills/particle-system-get/SKILL.md new file mode 100644 index 0000000..15ca66e --- /dev/null +++ b/.agent/skills/particle-system-get/SKILL.md @@ -0,0 +1,542 @@ +--- +name: particle-system-get +description: Inspect a `UnityEngine.ParticleSystem` component on a GameObject — runtime state (playing/paused/emitting/stopped, particle count, time) plus opt-in serialized data for any of the ~24 particle modules (Main, Emission, Shape, Velocity, Noise, Collision, Trails, Renderer, etc.). Pair with 'particle-system-modify' to write changes back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# ParticleSystem / Get + +Inspect a `UnityEngine.ParticleSystem` component on a GameObject. Returns runtime state (`isPlaying`, `isPaused`, `isEmitting`, `isStopped`, `particleCount`, `time`) plus opt-in serialized data for any of the particle modules. Use 'particle-system-modify' afterwards to write changes back. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required). +- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than one; otherwise the first `ParticleSystem` found is used. +- `includeMain`, `includeEmission`, `includeShape`, `includeVelocityOverLifetime`, `includeLimitVelocityOverLifetime`, `includeInheritVelocity`, `includeLifetimeByEmitterSpeed`, `includeForceOverLifetime`, `includeColorOverLifetime`, `includeColorBySpeed`, `includeSizeOverLifetime`, `includeSizeBySpeed`, `includeRotationOverLifetime`, `includeRotationBySpeed`, `includeExternalForces`, `includeNoise`, `includeCollision`, `includeTrigger`, `includeSubEmitters`, `includeTextureSheetAnimation`, `includeLights`, `includeTrails`, `includeCustomData`, `includeRenderer` — per-module toggles. `includeMain` defaults to `true`; everything else defaults to `false`. +- `includeAll` — when `true`, overrides every per-module flag and emits all modules. +- `deepSerialization` — when `true`, recurses through nested objects via ReflectorNet; otherwise only top-level members are serialized (cheaper, smaller payload). + +## Behavior + +Only the modules whose include-flags resolve to `true` are serialized — this keeps responses small when you only need one or two modules. `includeRenderer` reads the sibling `UnityEngine.ParticleSystemRenderer` component on the same GameObject and is skipped silently when no renderer is present. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool particle-system-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "includeMain": false, + "includeEmission": false, + "includeShape": false, + "includeVelocityOverLifetime": false, + "includeLimitVelocityOverLifetime": false, + "includeInheritVelocity": false, + "includeLifetimeByEmitterSpeed": false, + "includeForceOverLifetime": false, + "includeColorOverLifetime": false, + "includeColorBySpeed": false, + "includeSizeOverLifetime": false, + "includeSizeBySpeed": false, + "includeRotationOverLifetime": false, + "includeRotationBySpeed": false, + "includeExternalForces": false, + "includeNoise": false, + "includeCollision": false, + "includeTrigger": false, + "includeSubEmitters": false, + "includeTextureSheetAnimation": false, + "includeLights": false, + "includeTrails": false, + "includeCustomData": false, + "includeRenderer": false, + "includeAll": false, + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool particle-system-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool particle-system-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the ParticleSystem component. | +| `componentRef` | `any` | No | Optional reference to a specific ParticleSystem component if the GameObject has multiple. If not provided, uses the first ParticleSystem found. | +| `includeMain` | `boolean` | No | Include Main module data (duration, looping, prewarm, startDelay, startLifetime, startSpeed, startSize, startRotation, startColor, gravityModifier, simulationSpace, scalingMode, playOnAwake, maxParticles, etc.). | +| `includeEmission` | `boolean` | No | Include Emission module data (rateOverTime, rateOverDistance, bursts). | +| `includeShape` | `boolean` | No | Include Shape module data (shapeType, radius, angle, arc, position, rotation, scale, mesh, texture, etc.). | +| `includeVelocityOverLifetime` | `boolean` | No | Include Velocity over Lifetime module data (x, y, z, space, orbital, radial, speedModifier). | +| `includeLimitVelocityOverLifetime` | `boolean` | No | Include Limit Velocity over Lifetime module data (limit, dampen, separateAxes, drag). | +| `includeInheritVelocity` | `boolean` | No | Include Inherit Velocity module data (mode, curve). | +| `includeLifetimeByEmitterSpeed` | `boolean` | No | Include Lifetime by Emitter Speed module data (curve, range). | +| `includeForceOverLifetime` | `boolean` | No | Include Force over Lifetime module data (x, y, z, space, randomized). | +| `includeColorOverLifetime` | `boolean` | No | Include Color over Lifetime module data (color gradient). | +| `includeColorBySpeed` | `boolean` | No | Include Color by Speed module data (color, range). | +| `includeSizeOverLifetime` | `boolean` | No | Include Size over Lifetime module data (size curve, separateAxes). | +| `includeSizeBySpeed` | `boolean` | No | Include Size by Speed module data (size, range). | +| `includeRotationOverLifetime` | `boolean` | No | Include Rotation over Lifetime module data (angular velocity, separateAxes). | +| `includeRotationBySpeed` | `boolean` | No | Include Rotation by Speed module data (angular velocity, range). | +| `includeExternalForces` | `boolean` | No | Include External Forces module data (multiplier, influenceFilter). | +| `includeNoise` | `boolean` | No | Include Noise module data (strength, frequency, scrollSpeed, damping, octaves, quality, remap). | +| `includeCollision` | `boolean` | No | Include Collision module data (type, mode, planes, dampen, bounce, lifetimeLoss). | +| `includeTrigger` | `boolean` | No | Include Trigger module data (inside, outside, enter, exit actions). | +| `includeSubEmitters` | `boolean` | No | Include Sub Emitters module data (birth, collision, death, trigger, manual emitters). | +| `includeTextureSheetAnimation` | `boolean` | No | Include Texture Sheet Animation module data (mode, tiles, animation, frameOverTime). | +| `includeLights` | `boolean` | No | Include Lights module data (ratio, light, color, range, intensity). | +| `includeTrails` | `boolean` | No | Include Trails module data (mode, ratio, lifetime, width, color). | +| `includeCustomData` | `boolean` | No | Include Custom Data module data (modes, vectors, colors). | +| `includeRenderer` | `boolean` | No | Include Renderer module data (renderMode, material, sortMode, alignment, shadows). | +| `includeAll` | `boolean` | No | Include ALL modules data. Overrides individual flags. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including all nested objects. Otherwise, only serializes top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "includeMain": { + "type": "boolean" + }, + "includeEmission": { + "type": "boolean" + }, + "includeShape": { + "type": "boolean" + }, + "includeVelocityOverLifetime": { + "type": "boolean" + }, + "includeLimitVelocityOverLifetime": { + "type": "boolean" + }, + "includeInheritVelocity": { + "type": "boolean" + }, + "includeLifetimeByEmitterSpeed": { + "type": "boolean" + }, + "includeForceOverLifetime": { + "type": "boolean" + }, + "includeColorOverLifetime": { + "type": "boolean" + }, + "includeColorBySpeed": { + "type": "boolean" + }, + "includeSizeOverLifetime": { + "type": "boolean" + }, + "includeSizeBySpeed": { + "type": "boolean" + }, + "includeRotationOverLifetime": { + "type": "boolean" + }, + "includeRotationBySpeed": { + "type": "boolean" + }, + "includeExternalForces": { + "type": "boolean" + }, + "includeNoise": { + "type": "boolean" + }, + "includeCollision": { + "type": "boolean" + }, + "includeTrigger": { + "type": "boolean" + }, + "includeSubEmitters": { + "type": "boolean" + }, + "includeTextureSheetAnimation": { + "type": "boolean" + }, + "includeLights": { + "type": "boolean" + }, + "includeTrails": { + "type": "boolean" + }, + "includeCustomData": { + "type": "boolean" + }, + "includeRenderer": { + "type": "boolean" + }, + "includeAll": { + "type": "boolean" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.GetParticleSystemResponse", + "description": "Response containing ParticleSystem data with requested modules." + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.GetParticleSystemResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the ParticleSystem component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the ParticleSystem component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the ParticleSystem component in the GameObject's component list." + }, + "isPlaying": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently playing." + }, + "isPaused": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently paused." + }, + "isEmitting": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently emitting." + }, + "isStopped": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently stopped." + }, + "particleCount": { + "type": "integer", + "description": "Current particle count." + }, + "time": { + "type": "number", + "description": "Current simulation time." + }, + "main": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Main module data." + }, + "emission": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Emission module data." + }, + "shape": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Shape module data." + }, + "velocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Velocity over Lifetime module data." + }, + "limitVelocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Limit Velocity over Lifetime module data." + }, + "inheritVelocity": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Inherit Velocity module data." + }, + "lifetimeByEmitterSpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Lifetime by Emitter Speed module data." + }, + "forceOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Force over Lifetime module data." + }, + "colorOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Color over Lifetime module data." + }, + "colorBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Color by Speed module data." + }, + "sizeOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Size over Lifetime module data." + }, + "sizeBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Size by Speed module data." + }, + "rotationOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Rotation over Lifetime module data." + }, + "rotationBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Rotation by Speed module data." + }, + "externalForces": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "External Forces module data." + }, + "noise": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Noise module data." + }, + "collision": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Collision module data." + }, + "trigger": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Trigger module data." + }, + "subEmitters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Sub Emitters module data." + }, + "textureSheetAnimation": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Texture Sheet Animation module data." + }, + "lights": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Lights module data." + }, + "trails": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Trails module data." + }, + "customData": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Custom Data module data." + }, + "renderer": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Renderer module data." + } + }, + "required": [ + "componentIndex", + "isPlaying", + "isPaused", + "isEmitting", + "isStopped", + "particleCount", + "time" + ], + "description": "Response containing ParticleSystem data with requested modules." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/particle-system-modify/SKILL.md b/.agent/skills/particle-system-modify/SKILL.md new file mode 100644 index 0000000..3185158 --- /dev/null +++ b/.agent/skills/particle-system-modify/SKILL.md @@ -0,0 +1,419 @@ +--- +name: particle-system-modify +description: Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass `SerializedMember` payloads only for the modules you want to change; everything else is left alone. Use 'particle-system-get' first to inspect the current structure. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# ParticleSystem / Modify + +Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass `SerializedMember` payloads only for the modules you want to change; omitted modules are left untouched. Use 'particle-system-get' first to inspect the current structure so the diff is targeted. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required). +- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than one; otherwise the first `ParticleSystem` found is used. +- `main`, `emission`, `shape`, `velocityOverLifetime`, `limitVelocityOverLifetime`, `inheritVelocity`, `lifetimeByEmitterSpeed`, `forceOverLifetime`, `colorOverLifetime`, `colorBySpeed`, `sizeOverLifetime`, `sizeBySpeed`, `rotationOverLifetime`, `rotationBySpeed`, `externalForces`, `noise`, `collision`, `trigger`, `subEmitters`, `textureSheetAnimation`, `lights`, `trails`, `customData`, `renderer` — optional `SerializedMember` payloads per module. Include only the properties you want to change. + +## Behavior + +Each non-null module is applied via `Reflector.TryModify` and logged with a `[ModuleName]` prefix in the response's `logs` array. The `renderer` payload targets the sibling `UnityEngine.ParticleSystemRenderer` component on the same GameObject; if absent, the call logs the miss instead of throwing. When at least one module was modified, the GameObject and the `ParticleSystem` are marked dirty so the change persists. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool particle-system-modify --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "main": "string_value", + "emission": "string_value", + "shape": "string_value", + "velocityOverLifetime": "string_value", + "limitVelocityOverLifetime": "string_value", + "inheritVelocity": "string_value", + "lifetimeByEmitterSpeed": "string_value", + "forceOverLifetime": "string_value", + "colorOverLifetime": "string_value", + "colorBySpeed": "string_value", + "sizeOverLifetime": "string_value", + "sizeBySpeed": "string_value", + "rotationOverLifetime": "string_value", + "rotationBySpeed": "string_value", + "externalForces": "string_value", + "noise": "string_value", + "collision": "string_value", + "trigger": "string_value", + "subEmitters": "string_value", + "textureSheetAnimation": "string_value", + "lights": "string_value", + "trails": "string_value", + "customData": "string_value", + "renderer": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool particle-system-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool particle-system-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the ParticleSystem component. | +| `componentRef` | `any` | No | Optional reference to a specific ParticleSystem component if the GameObject has multiple. If not provided, uses the first ParticleSystem found. | +| `main` | `any` | No | Main module data to apply. Only include properties you want to change. | +| `emission` | `any` | No | Emission module data to apply. Only include properties you want to change. | +| `shape` | `any` | No | Shape module data to apply. Only include properties you want to change. | +| `velocityOverLifetime` | `any` | No | Velocity over Lifetime module data to apply. Only include properties you want to change. | +| `limitVelocityOverLifetime` | `any` | No | Limit Velocity over Lifetime module data to apply. Only include properties you want to change. | +| `inheritVelocity` | `any` | No | Inherit Velocity module data to apply. Only include properties you want to change. | +| `lifetimeByEmitterSpeed` | `any` | No | Lifetime by Emitter Speed module data to apply. Only include properties you want to change. | +| `forceOverLifetime` | `any` | No | Force over Lifetime module data to apply. Only include properties you want to change. | +| `colorOverLifetime` | `any` | No | Color over Lifetime module data to apply. Only include properties you want to change. | +| `colorBySpeed` | `any` | No | Color by Speed module data to apply. Only include properties you want to change. | +| `sizeOverLifetime` | `any` | No | Size over Lifetime module data to apply. Only include properties you want to change. | +| `sizeBySpeed` | `any` | No | Size by Speed module data to apply. Only include properties you want to change. | +| `rotationOverLifetime` | `any` | No | Rotation over Lifetime module data to apply. Only include properties you want to change. | +| `rotationBySpeed` | `any` | No | Rotation by Speed module data to apply. Only include properties you want to change. | +| `externalForces` | `any` | No | External Forces module data to apply. Only include properties you want to change. | +| `noise` | `any` | No | Noise module data to apply. Only include properties you want to change. | +| `collision` | `any` | No | Collision module data to apply. Only include properties you want to change. | +| `trigger` | `any` | No | Trigger module data to apply. Only include properties you want to change. | +| `subEmitters` | `any` | No | Sub Emitters module data to apply. Only include properties you want to change. | +| `textureSheetAnimation` | `any` | No | Texture Sheet Animation module data to apply. Only include properties you want to change. | +| `lights` | `any` | No | Lights module data to apply. Only include properties you want to change. | +| `trails` | `any` | No | Trails module data to apply. Only include properties you want to change. | +| `customData` | `any` | No | Custom Data module data to apply. Only include properties you want to change. | +| `renderer` | `any` | No | Renderer module data to apply. Only include properties you want to change. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "main": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "emission": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "shape": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "velocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "limitVelocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "inheritVelocity": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "lifetimeByEmitterSpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "forceOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "colorOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "colorBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "sizeOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "sizeBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "rotationOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "rotationBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "externalForces": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "noise": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "collision": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trigger": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "subEmitters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "textureSheetAnimation": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "lights": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trails": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "customData": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "renderer": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.ModifyParticleSystemResponse", + "description": "Response containing the result of modifying a ParticleSystem." + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.ModifyParticleSystemResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the ParticleSystem component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified ParticleSystem component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the ParticleSystem component in the GameObject's component list." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications made and any warnings/errors encountered." + } + }, + "required": [ + "success", + "componentIndex" + ], + "description": "Response containing the result of modifying a ParticleSystem." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/ping/SKILL.md b/.agent/skills/ping/SKILL.md new file mode 100644 index 0000000..250f6c6 --- /dev/null +++ b/.agent/skills/ping/SKILL.md @@ -0,0 +1,82 @@ +--- +name: ping +description: Lightweight readiness probe. Returns the input `message` echoed back, or `'pong'` when omitted. Useful for CLI health checks and SignalR connectivity smoke tests. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Ping + +Lightweight readiness probe. Returns the input message or 'pong' if omitted. + +## Inputs + +- `message` (optional) — when present, echoed back verbatim. + +## Behavior + +No I/O, no Unity API calls — pure echo. Ideal for measuring round-trip latency or confirming the MCP transport is alive before invoking a heavier tool. + +## How to Call + +```bash +unity-mcp-cli run-system-tool ping --input '{ + "message": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-system-tool ping --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-system-tool ping --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `message` | `string` | No | Optional message to echo back. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-bevel/SKILL.md b/.agent/skills/probuilder-bevel/SKILL.md new file mode 100644 index 0000000..1af0ce0 --- /dev/null +++ b/.agent/skills/probuilder-bevel/SKILL.md @@ -0,0 +1,185 @@ +--- +name: probuilder-bevel +description: Bevel (chamfer) selected edges of a `ProBuilderMesh`, replacing each sharp edge with an angled face. Identify edges by their `[vertexA, vertexB]` index pairs — use 'probuilder-get-mesh-info' to discover them. `amount` is clamped to (0, 1). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Bevel ProBuilder edges + +Bevel (chamfer) selected edges of a `ProBuilderMesh`, replacing each sharp edge with an angled face for a smoother appearance. Use 'probuilder-get-mesh-info' first to discover edges by their vertex pairs. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — array of edge definitions; each edge is `[vertexA, vertexB]`. Example: `[[0,1], [2,3]]` bevels two edges. +- `amount` — bevel strength in the range (0, 1). `0.001` is barely visible, `0.999` reaches face center. Recommended `0.05`–`0.2`. Internally clamped. + +## Behavior + +Vertex indices are validated against `vertexCount`. After `BevelEdges` runs, the mesh is rebuilt (`ToMesh` → `Refresh`), the `ProBuilderMesh` and GameObject are marked dirty, and Editor windows repaint. Returns the number of edges processed, the clamped amount, and post-op face/vertex/edge counts. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-bevel --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "amount": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-bevel --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-bevel --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | Yes | Array of edge definitions. Each edge is defined by two vertex indices [vertexA, vertexB]. Example: [[0,1], [2,3]] bevels edges from vertex 0 to 1 and from vertex 2 to 3. | +| `amount` | `number` | No | Bevel amount from 0 (no bevel) to 1 (maximum bevel reaching face center). Recommended values: 0.05 to 0.2. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "amount": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + } + }, + "required": [ + "gameObjectRef", + "edges" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BevelResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BevelResponse": { + "type": "object", + "properties": { + "edgesBeveled": { + "type": "integer" + }, + "bevelAmount": { + "type": "number" + }, + "newFacesCreated": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "edgesBeveled", + "bevelAmount", + "newFacesCreated", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-bridge/SKILL.md b/.agent/skills/probuilder-bridge/SKILL.md new file mode 100644 index 0000000..888835d --- /dev/null +++ b/.agent/skills/probuilder-bridge/SKILL.md @@ -0,0 +1,206 @@ +--- +name: probuilder-bridge +description: Create a single new face that bridges two existing edges of a `ProBuilderMesh`. Useful for connecting separate parts of geometry or filling gaps. Pair with 'probuilder-get-mesh-info' to discover valid edges. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Bridge two edges in a ProBuilder mesh + +Create a single new face that bridges two existing edges of a `ProBuilderMesh`. Useful for connecting separate parts of geometry or filling gaps between disjoint sections. Pair with 'probuilder-get-mesh-info' to discover valid edges first. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edgeA` — first edge as `[vertexA, vertexB]`. +- `edgeB` — second edge as `[vertexA, vertexB]`. +- `allowNonManifold` — when `true`, permits the bridge to share an edge with more than two faces. Defaults to `false`. + +## Example + +`edgeA=[0,1]`, `edgeB=[4,5]` creates a quad face between the two edges. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. Returns the index of the new face, before/after face counts, and post-op vertex/edge counts. Throws when the bridge cannot be formed (e.g., edges already connected or non-manifold check blocked it). The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-bridge --input '{ + "gameObjectRef": "string_value", + "edgeA": "string_value", + "edgeB": "string_value", + "allowNonManifold": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-bridge --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-bridge --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edgeA` | `any` | Yes | First edge as [vertexA, vertexB]. | +| `edgeB` | `any` | Yes | Second edge as [vertexA, vertexB]. | +| `allowNonManifold` | `boolean` | No | If true, allows creation of non-manifold geometry (edges shared by more than 2 faces). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edgeA": { + "$ref": "#/$defs/System.Int32-1" + }, + "edgeB": { + "$ref": "#/$defs/System.Int32-1" + }, + "allowNonManifold": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "gameObjectRef", + "edgeA", + "edgeB" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BridgeResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BridgeResponse": { + "type": "object", + "properties": { + "edgeA": { + "$ref": "#/$defs/System.Int32-1" + }, + "edgeB": { + "$ref": "#/$defs/System.Int32-1" + }, + "newFaceIndex": { + "type": "integer" + }, + "allowNonManifold": { + "type": "boolean" + }, + "faceCountBefore": { + "type": "integer" + }, + "faceCountAfter": { + "type": "integer" + }, + "facesAdded": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "newFaceIndex", + "allowNonManifold", + "faceCountBefore", + "faceCountAfter", + "facesAdded", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-connect-edges/SKILL.md b/.agent/skills/probuilder-connect-edges/SKILL.md new file mode 100644 index 0000000..2f4c213 --- /dev/null +++ b/.agent/skills/probuilder-connect-edges/SKILL.md @@ -0,0 +1,215 @@ +--- +name: probuilder-connect-edges +description: Insert new edges connecting the midpoints of selected edges within faces of a `ProBuilderMesh` — adds edge loops and extra geometry detail. Supply either `edges` (explicit list) or `faceDirection` (semantic selection); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Connect edges in a ProBuilder mesh + +Insert new edges connecting the midpoints of selected edges within faces of a `ProBuilderMesh`. When a face has more than two edges to connect, a center vertex is added. Useful for creating new edge loops and adding geometry detail. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — explicit list of edges to connect, each as `[vertexA, vertexB]`. Use 'probuilder-get-mesh-info' to discover valid indices. +- `faceDirection` — semantic alternative: connects all edges of faces pointing this direction (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `edges` / `faceDirection` is required. + +## Examples + +- Connect opposite edges of the top face: `faceDirection="up"`. +- Connect specific edges: `edges=[[0,1], [2,3]]`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-connect-edges --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-connect-edges --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-connect-edges --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | No | Array of edge definitions. Each edge is [vertexA, vertexB]. Use ProBuilder_GetMeshInfo to get vertex indices. | +| `faceDirection` | `any` | No | Semantic face selection - connect edges of faces facing this direction. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ConnectEdgesResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ConnectEdgesResponse": { + "type": "object", + "properties": { + "selectionMethod": { + "type": "string" + }, + "edgesConnected": { + "type": "integer" + }, + "newFacesCreated": { + "type": "integer" + }, + "newEdgesCreated": { + "type": "integer" + }, + "faceCountBefore": { + "type": "integer" + }, + "faceCountAfter": { + "type": "integer" + }, + "facesAdded": { + "type": "integer" + }, + "edgeCountBefore": { + "type": "integer" + }, + "edgeCountAfter": { + "type": "integer" + }, + "edgesAdded": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + } + }, + "required": [ + "edgesConnected", + "newFacesCreated", + "newEdgesCreated", + "faceCountBefore", + "faceCountAfter", + "facesAdded", + "edgeCountBefore", + "edgeCountAfter", + "edgesAdded", + "totalVertexCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-create-poly-shape/SKILL.md b/.agent/skills/probuilder-create-poly-shape/SKILL.md new file mode 100644 index 0000000..8e2f188 --- /dev/null +++ b/.agent/skills/probuilder-create-poly-shape/SKILL.md @@ -0,0 +1,288 @@ +--- +name: probuilder-create-poly-shape +description: Create a 3D `ProBuilderMesh` from a 2D polygon outline (x,z points) extruded upward by `height`. Perfect for floor plans, room layouts, terrain patches, walls, platforms — any shape definable by a 2D outline. Requires ≥3 points. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Create a ProBuilder shape from polygon points + +Create a 3D `ProBuilderMesh` from a 2D polygon outline (x,z points) extruded upward by `height`. Perfect for: + +- Floor plans and room layouts. +- Custom terrain patches. +- Architectural elements (walls, platforms). +- Any shape that can be defined by a 2D outline. + +## Inputs + +- `points` — array of 2D points as `[x, z]`. Minimum 3 points; should be in clockwise or counter-clockwise order. +- `height` — extrusion height upward (Y axis). Default `1`. +- `name` — optional GameObject name. +- `parentGameObjectRef` — optional parent; root of the scene when omitted. +- `position`, `rotation` — optional `Vector3` transform values (rotation in euler degrees). +- `flipNormals` — when `true`, flip the resulting face normals so the shape points inward. +- `isLocalSpace` — when `true`, position/rotation are interpreted in the parent's local space. + +## Examples + +- Rectangle: `points=[[0,0], [4,0], [4,3], [0,3]]`, `height=2.5`. +- L-shape: `points=[[0,0], [3,0], [3,2], [1,2], [1,3], [0,3]]`, `height=3`. +- Triangle: `points=[[0,0], [2,0], [1,1.7]]`, `height=1`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-create-poly-shape --input '{ + "points": "string_value", + "height": 0, + "name": "string_value", + "parentGameObjectRef": "string_value", + "position": "string_value", + "rotation": "string_value", + "flipNormals": false, + "isLocalSpace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-create-poly-shape --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-create-poly-shape --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `points` | `any` | Yes | 2D polygon points as [x,z] coordinates. Minimum 3 points. Points should be in clockwise or counter-clockwise order. Example: [[0,0], [4,0], [4,3], [0,3]] creates a 4x3 rectangle. | +| `height` | `number` | No | Height to extrude the polygon upward. Default is 1. | +| `name` | `string` | No | Name of the new GameObject. | +| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. | +| `position` | `any` | No | Position of the shape in world or local space. | +| `rotation` | `any` | No | Rotation of the shape in euler angles (degrees). | +| `flipNormals` | `boolean` | No | If true, flip the normals so the faces point inward instead of outward. | +| `isLocalSpace` | `boolean` | No | If true, position/rotation are in local space relative to parent. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "points": { + "$ref": "#/$defs/System.Single-1-1" + }, + "height": { + "type": "number" + }, + "name": { + "type": "string" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "flipNormals": { + "type": "boolean" + }, + "isLocalSpace": { + "type": "boolean" + } + }, + "$defs": { + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "points" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreatePolyShapeResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "x": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "index", + "x", + "z" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreatePolyShapeResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "position": { + "type": "string" + }, + "rotation": { + "type": "string" + }, + "pointCount": { + "type": "integer" + }, + "height": { + "type": "number" + }, + "flipNormals": { + "type": "boolean" + }, + "boundsSize": { + "type": "string" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + }, + "inputPoints": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo)" + } + }, + "required": [ + "instanceId", + "pointCount", + "height", + "flipNormals", + "faceCount", + "vertexCount", + "edgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-create-shape/SKILL.md b/.agent/skills/probuilder-create-shape/SKILL.md new file mode 100644 index 0000000..0e349aa --- /dev/null +++ b/.agent/skills/probuilder-create-shape/SKILL.md @@ -0,0 +1,246 @@ +--- +name: probuilder-create-shape +description: Create a new editable `ProBuilderMesh` GameObject in the active scene from a `ShapeType` primitive (Cube, Cylinder, Sphere, Plane, Prism, Cone, Stair, etc.). Optionally set name, parent, transform, size, and world/local space. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Create a ProBuilder shape + +Create a new editable `ProBuilderMesh` GameObject in the active scene. ProBuilder shapes are editable 3D meshes that can be further modified with the rest of the ProBuilder tools (extrude, bevel, subdivide, etc.). + +## Inputs + +- `shapeType` — `ShapeType` enum (Cube, Cylinder, Sphere, Plane, Prism, Cone, Stair, Door, Pipe, Arch, Sprite, Torus, etc.). +- `name` — optional GameObject name. +- `parentGameObjectRef` — optional parent; root of the scene when omitted. +- `position`, `rotation`, `scale` — optional `Vector3` transform values. Rotation is euler degrees. Defaults: zero / zero / one. +- `size` — `Vector3` width/height/depth of the generated shape. Default `(1, 1, 1)`. +- `isLocalSpace` — when `true`, position/rotation/scale are interpreted in the parent's local space; otherwise world space. + +## Behavior + +Uses `ShapeGenerator.CreateShape` with `PivotLocation.Center`, applies the transform values, rebuilds the mesh, marks dirty, and repaints the Editor. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-create-shape --input '{ + "shapeType": "string_value", + "name": "string_value", + "parentGameObjectRef": "string_value", + "position": "string_value", + "rotation": "string_value", + "scale": "string_value", + "size": "string_value", + "isLocalSpace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-create-shape --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-create-shape --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `shapeType` | `string` | Yes | The type of shape to create. | +| `name` | `string` | No | Name of the new GameObject. | +| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. | +| `position` | `any` | No | Position of the shape in world or local space. | +| `rotation` | `any` | No | Rotation of the shape in euler angles (degrees). | +| `scale` | `any` | No | Scale of the shape. | +| `size` | `any` | No | Size of the shape (width, height, depth). Default is (1, 1, 1). | +| `isLocalSpace` | `boolean` | No | If true, position/rotation/scale are in local space relative to parent. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "shapeType": { + "type": "string", + "enum": [ + "Cube", + "Stair", + "CurvedStair", + "Prism", + "Cylinder", + "Plane", + "Door", + "Pipe", + "Cone", + "Sprite", + "Arch", + "Sphere", + "Torus" + ] + }, + "name": { + "type": "string" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "isLocalSpace": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "shapeType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreateShapeResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreateShapeResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "shapeType": { + "type": "string" + }, + "position": { + "type": "string" + }, + "rotation": { + "type": "string" + }, + "scale": { + "type": "string" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + } + }, + "required": [ + "instanceId", + "faceCount", + "vertexCount", + "edgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-delete-faces/SKILL.md b/.agent/skills/probuilder-delete-faces/SKILL.md new file mode 100644 index 0000000..2f289c9 --- /dev/null +++ b/.agent/skills/probuilder-delete-faces/SKILL.md @@ -0,0 +1,206 @@ +--- +name: probuilder-delete-faces +description: Delete selected faces from a `ProBuilderMesh`, creating holes or removing geometry. Supply either `faceIndices` (explicit list) or `faceDirection` (semantic selection); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Delete ProBuilder faces + +Delete selected faces from a `ProBuilderMesh`, creating holes or removing geometry entirely. Faces can be selected explicitly by index or semantically by direction. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — explicit array of face indices to delete. Use 'probuilder-get-mesh-info' to discover valid indices. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. + +## Examples + +- Delete the bottom face: `faceDirection="down"`. +- Delete specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), the `ProBuilderMesh` and GameObject are marked dirty, and Editor windows repaint. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-delete-faces --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-delete-faces --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-delete-faces --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to delete. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-DeleteFacesResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-DeleteFacesResponse": { + "type": "object", + "properties": { + "deletedFaceCount": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "deletedFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "facesRemoved": { + "type": "integer" + }, + "verticesRemoved": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "deletedFaceCount", + "facesRemoved", + "verticesRemoved", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-extrude/SKILL.md b/.agent/skills/probuilder-extrude/SKILL.md new file mode 100644 index 0000000..c12f404 --- /dev/null +++ b/.agent/skills/probuilder-extrude/SKILL.md @@ -0,0 +1,229 @@ +--- +name: probuilder-extrude +description: Extrude selected faces of a `ProBuilderMesh` along their normals, creating new geometry. Supply either `faceIndices` (explicit) or `faceDirection` (semantic); exactly one is required. Positive `distance` extrudes outward, negative inward. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Extrude ProBuilder faces + +Extrude selected faces of a `ProBuilderMesh` along their normals, creating new geometry by pushing faces outward (positive distance) or inward (negative distance). Faces can be selected explicitly by index or semantically by direction. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — explicit array of face indices to extrude. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. +- `distance` — extrusion distance. Positive = outward, negative = inward. Default `0.5`. +- `extrudeMethod` — `IndividualFaces` (each face extrudes independently), `FaceNormal` (faces extrude as a group along the averaged normal — the default), or `VertexNormal` (vertices move along their normals). + +## Examples + +- Extrude the top face up by 1 unit: `faceDirection="up"`, `distance=1`. +- Extrude specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-extrude --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value", + "distance": 0, + "extrudeMethod": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-extrude --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-extrude --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to extrude. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | +| `distance` | `number` | No | Distance to extrude the faces. Positive values extrude outward along face normals, negative values extrude inward. | +| `extrudeMethod` | `string` | No | Extrusion method: IndividualFaces (each face extrudes independently), FaceNormal (faces extrude as a group along averaged normal), VertexNormal (vertices move along their normals). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + }, + "distance": { + "type": "number" + }, + "extrudeMethod": { + "type": "string", + "enum": [ + "IndividualFaces", + "VertexNormal", + "FaceNormal" + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ExtrudeResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ExtrudeResponse": { + "type": "object", + "properties": { + "extrudedFaceCount": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "extrudedFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "extrudeMethod": { + "type": "string" + }, + "distance": { + "type": "number" + }, + "newFacesCreated": { + "type": "integer" + }, + "newFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "extrudedFaceCount", + "distance", + "newFacesCreated", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-flip-normals/SKILL.md b/.agent/skills/probuilder-flip-normals/SKILL.md new file mode 100644 index 0000000..c325892 --- /dev/null +++ b/.agent/skills/probuilder-flip-normals/SKILL.md @@ -0,0 +1,197 @@ +--- +name: probuilder-flip-normals +description: Reverse the normal direction of selected faces in a `ProBuilderMesh`, flipping them inside-out. Useful for creating interior spaces (a room from the inside of a cube) or fixing inverted faces. Defaults to all faces when no selection is supplied. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Flip face normals in a ProBuilder mesh + +Reverse the normal direction of selected faces in a `ProBuilderMesh`, flipping them inside-out. Useful for creating interior spaces (a room from the inside of a cube) or fixing inverted faces produced by other operations. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — optional explicit list of face indices to flip. +- `faceDirection` — optional semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). + +When both are omitted, **every face** is flipped. + +## Examples + +- Flip all faces: leave both `faceIndices` and `faceDirection` empty. +- Flip top face only: `faceDirection=Up`. +- Flip specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-flip-normals --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-flip-normals --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-flip-normals --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to flip. If empty and faceDirection is empty, flips all faces. | +| `faceDirection` | `any` | No | Semantic face selection by direction. If empty and faceIndices is empty, flips all faces. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FlipNormalsResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FlipNormalsResponse": { + "type": "object", + "properties": { + "facesFlipped": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + } + }, + "required": [ + "facesFlipped", + "totalFaceCount", + "totalVertexCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-get-mesh-info/SKILL.md b/.agent/skills/probuilder-get-mesh-info/SKILL.md new file mode 100644 index 0000000..be313ee --- /dev/null +++ b/.agent/skills/probuilder-get-mesh-info/SKILL.md @@ -0,0 +1,333 @@ +--- +name: probuilder-get-mesh-info +description: "Inspect a `ProBuilderMesh` — face/vertex/edge counts plus optional face-by-face detail. Use `detail=\"summary\"` for a token-efficient overview, `detail=\"full\"` for detailed face data. Often skippable when other tools accept `faceDirection` semantic selection." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Get ProBuilder mesh information + +Inspect a `ProBuilderMesh` — totals (face/vertex/edge counts) plus optional face-by-face detail (per-face vertex positions, edges, semantic direction). The other ProBuilder tools accept `faceDirection` (semantic selection like `"up"`, `"down"`) — when that suffices, you can skip this call entirely. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `detail` — `Summary` (default, cheap overview with face directions) or `Full` (per-face data). +- `includeVertexPositions` — `Full` only. Include each face's vertex positions in the response. +- `includeEdges` — `Full` only. Include each face's edges. Default `true`. +- `maxFacesToShow` — `Full` only. Cap on face-detail entries (default `20`; pass `-1` for all). Keeps the response small for high-face meshes. + +## Tip + +With semantic face selection (`faceDirection`) available on Extrude / DeleteFaces / SetFaceMaterial and friends, you often don't need this tool — just pass `faceDirection="up"` etc. directly. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-get-mesh-info --input '{ + "gameObjectRef": "string_value", + "detail": "string_value", + "includeVertexPositions": false, + "includeEdges": false, + "maxFacesToShow": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-get-mesh-info --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-get-mesh-info --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `detail` | `string` | No | Detail level for output. | +| `includeVertexPositions` | `boolean` | No | If true, includes detailed vertex positions for each face (only with detail='full'). | +| `includeEdges` | `boolean` | No | If true, includes edge information for each face (only with detail='full'). | +| `maxFacesToShow` | `integer` | No | Maximum number of faces to include in detail (only with detail='full'). Use -1 for all faces. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "detail": { + "type": "string", + "enum": [ + "Summary", + "Full" + ] + }, + "includeVertexPositions": { + "type": "boolean" + }, + "includeEdges": { + "type": "boolean" + }, + "maxFacesToShow": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-GetMeshInfoResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BoundsInfo": { + "type": "object", + "properties": { + "center": { + "type": "string" + }, + "size": { + "type": "string" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + } + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo": { + "type": "object", + "properties": { + "direction": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "firstFaceCenter": { + "type": "string" + } + } + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "triangleCount": { + "type": "integer" + }, + "center": { + "type": "string" + }, + "vertices": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo)" + }, + "edges": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo)" + } + }, + "required": [ + "index", + "vertexCount", + "triangleCount" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "position": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo": { + "type": "object", + "properties": { + "vertexA": { + "type": "integer" + }, + "vertexB": { + "type": "integer" + }, + "positionA": { + "type": "string" + }, + "positionB": { + "type": "string" + } + }, + "required": [ + "vertexA", + "vertexB" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-GetMeshInfoResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + }, + "triangleCount": { + "type": "integer" + }, + "bounds": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BoundsInfo" + }, + "faceDirections": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo)" + }, + "faces": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo)" + }, + "facesShown": { + "type": "integer" + }, + "facesTotal": { + "type": "integer" + }, + "uniqueEdgeCount": { + "type": "integer" + } + }, + "required": [ + "instanceId", + "faceCount", + "vertexCount", + "edgeCount", + "triangleCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-merge-objects/SKILL.md b/.agent/skills/probuilder-merge-objects/SKILL.md new file mode 100644 index 0000000..1fc7933 --- /dev/null +++ b/.agent/skills/probuilder-merge-objects/SKILL.md @@ -0,0 +1,241 @@ +--- +name: probuilder-merge-objects +description: Combine multiple `ProBuilderMesh` GameObjects into one merged mesh. The first GameObject in the list becomes the merge target. Source GameObjects are deleted by default. Useful for optimizing draw calls and unifying composite props. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Merge multiple ProBuilder meshes into one + +Combine multiple `ProBuilderMesh` GameObjects into a single merged mesh. The first GameObject in `gameObjectRefs` becomes the merge target — subsequent meshes are absorbed into it. Useful for optimizing draw calls or creating a unified object from parts. + +## Inputs + +- `gameObjectRefs` — array of GameObject references (≥2). Each must carry a `ProBuilderMesh` component. The first reference is the merge target. +- `deleteSourceObjects` — when `true` (default), delete the non-target source GameObjects after merging. Set `false` to keep them in the scene. + +## Example + +Merge a table assembled from four leg meshes and a top into a single GameObject for shipping. + +## Behavior + +All meshes are rebuilt (`ToMesh` → `Refresh`), the resulting GameObject is marked dirty, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-merge-objects --input '{ + "gameObjectRefs": "string_value", + "deleteSourceObjects": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-merge-objects --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-merge-objects --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRefs` | `any` | Yes | Array of GameObject references with ProBuilderMesh components to merge. First object becomes the merge target. | +| `deleteSourceObjects` | `boolean` | No | If true, delete the source GameObjects after merging (except the target). Default is true. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRefs": { + "$ref": "#/$defs/AIGD.GameObjectRef-1" + }, + "deleteSourceObjects": { + "type": "boolean" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } + }, + "required": [ + "gameObjectRefs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MergeObjectsResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + } + }, + "required": [ + "instanceId" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MergeObjectsResponse": { + "type": "object", + "properties": { + "mergedMeshCount": { + "type": "integer" + }, + "resultMeshCount": { + "type": "integer" + }, + "targetObjectName": { + "type": "string" + }, + "targetInstanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "objectsDeleted": { + "type": "integer" + }, + "totalFacesBefore": { + "type": "integer" + }, + "totalFacesAfter": { + "type": "integer" + }, + "totalVerticesBefore": { + "type": "integer" + }, + "totalVerticesAfter": { + "type": "integer" + }, + "sourceObjects": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo)" + }, + "additionalMeshes": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo)" + } + }, + "required": [ + "mergedMeshCount", + "resultMeshCount", + "targetInstanceId", + "objectsDeleted", + "totalFacesBefore", + "totalFacesAfter", + "totalVerticesBefore", + "totalVerticesAfter" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-set-face-material/SKILL.md b/.agent/skills/probuilder-set-face-material/SKILL.md new file mode 100644 index 0000000..8267fa7 --- /dev/null +++ b/.agent/skills/probuilder-set-face-material/SKILL.md @@ -0,0 +1,219 @@ +--- +name: probuilder-set-face-material +description: Assign a material to specific faces of a `ProBuilderMesh`, enabling multi-material meshes (e.g., grass on top, dirt on sides). Supply either `faceIndices` (explicit) or `faceDirection` (semantic); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Set material on ProBuilder faces + +Assign a material to specific faces of a `ProBuilderMesh`, enabling multi-material meshes where different faces have different materials (e.g., grass on top, dirt on the sides). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `materialPath` — project path to the material asset (e.g., `Assets/Materials/Grass.mat`) or a bare material name. Required. +- `faceIndices` — explicit array of face indices. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. + +## Examples + +- Set material on the top face: `faceDirection="up"`. +- Set material on specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-set-face-material --input '{ + "gameObjectRef": "string_value", + "materialPath": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-set-face-material --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-set-face-material --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `materialPath` | `string` | Yes | Path to the material asset (e.g., 'Assets/Materials/MyMaterial.mat') or material name. | +| `faceIndices` | `any` | No | Array of face indices to apply the material to. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "materialPath": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef", + "materialPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetFaceMaterialResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetFaceMaterialResponse": { + "type": "object", + "properties": { + "materialName": { + "type": "string" + }, + "materialIndex": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "facesUpdated": { + "$ref": "#/$defs/System.Int32-1" + }, + "meshMaterials": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo)" + } + }, + "required": [ + "materialIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-set-pivot/SKILL.md b/.agent/skills/probuilder-set-pivot/SKILL.md new file mode 100644 index 0000000..b6e215d --- /dev/null +++ b/.agent/skills/probuilder-set-pivot/SKILL.md @@ -0,0 +1,195 @@ +--- +name: probuilder-set-pivot +description: Move the pivot (origin) of a `ProBuilderMesh` without shifting the visible geometry. Choose `Center` (mesh bounds), `FirstVertex`, or `Custom` (world-space position). The mesh data is rebaked so the visual position stays fixed. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Set the pivot point of a ProBuilder mesh + +Move the pivot (origin) of a `ProBuilderMesh` without shifting the visible geometry. The mesh data is rebaked so the visual position stays fixed while the GameObject's transform origin moves to the new pivot. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `pivotLocation` — `MeshPivotLocation` enum: `Center` (mesh bounds center), `FirstVertex`, or `Custom`. +- `customPosition` — required when `pivotLocation = Custom`. World-space pivot position. + +## Examples + +- Center the pivot: `pivotLocation=Center`. +- Set pivot to first vertex: `pivotLocation=FirstVertex`. +- Set custom pivot: `pivotLocation=Custom`, `customPosition=(0, 0, 0)`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-set-pivot --input '{ + "gameObjectRef": "string_value", + "pivotLocation": "string_value", + "customPosition": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-set-pivot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-set-pivot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `pivotLocation` | `string` | No | Where to place the pivot. | +| `customPosition` | `any` | No | Custom world position for pivot (only used when pivotLocation=Custom). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "pivotLocation": { + "type": "string", + "enum": [ + "Center", + "FirstVertex", + "Custom" + ] + }, + "customPosition": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetPivotResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetPivotResponse": { + "type": "object", + "properties": { + "pivotLocation": { + "type": "string" + }, + "oldPivot": { + "type": "string" + }, + "newPivot": { + "type": "string" + }, + "offsetApplied": { + "type": "string" + }, + "gameObjectName": { + "type": "string" + }, + "newPosition": { + "type": "string" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/probuilder-subdivide-edges/SKILL.md b/.agent/skills/probuilder-subdivide-edges/SKILL.md new file mode 100644 index 0000000..a8af464 --- /dev/null +++ b/.agent/skills/probuilder-subdivide-edges/SKILL.md @@ -0,0 +1,221 @@ +--- +name: probuilder-subdivide-edges +description: Insert new vertices on selected edges of a `ProBuilderMesh`, splitting each edge into smaller segments. Supply either `edges` (explicit list) or `faceDirection` (subdivides all edges of faces facing that direction); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Subdivide edges in a ProBuilder mesh + +Insert new vertices on selected edges of a `ProBuilderMesh`, subdividing each into smaller segments. Useful for adding detail to specific edges for further manipulation (extrude, bevel, etc.). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — explicit list of edges to subdivide, each as `[vertexA, vertexB]`. Use 'probuilder-get-mesh-info' to discover valid edges. +- `faceDirection` — semantic alternative: subdivides all edges of faces pointing this direction (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `edges` / `faceDirection` is required. +- `subdivisions` — number of subdivisions per edge. `1` splits each edge in half, `2` into thirds, and so on. Default `1`. + +## Examples + +- Subdivide all edges of the top face: `faceDirection="up"`, `subdivisions=2`. +- Subdivide specific edges: `edges=[[0,1], [2,3]]`, `subdivisions=1`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-subdivide-edges --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "faceDirection": "string_value", + "subdivisions": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-subdivide-edges --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-subdivide-edges --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | No | Array of edge definitions. Each edge is [vertexA, vertexB]. Use ProBuilder_GetMeshInfo to get vertex indices. | +| `faceDirection` | `any` | No | Semantic face selection - subdivide all edges of faces facing this direction. | +| `subdivisions` | `integer` | No | Number of subdivisions per edge. 1 = splits edge in half, 2 = splits into thirds, etc. Default is 1. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + }, + "subdivisions": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SubdivideEdgesResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SubdivideEdgesResponse": { + "type": "object", + "properties": { + "selectionMethod": { + "type": "string" + }, + "edgesSubdivided": { + "type": "integer" + }, + "subdivisionsPerEdge": { + "type": "integer" + }, + "newEdgesCreated": { + "type": "integer" + }, + "vertexCountBefore": { + "type": "integer" + }, + "vertexCountAfter": { + "type": "integer" + }, + "verticesAdded": { + "type": "integer" + }, + "edgeCountBefore": { + "type": "integer" + }, + "edgeCountAfter": { + "type": "integer" + }, + "edgesAdded": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + } + }, + "required": [ + "edgesSubdivided", + "subdivisionsPerEdge", + "newEdgesCreated", + "vertexCountBefore", + "vertexCountAfter", + "verticesAdded", + "edgeCountBefore", + "edgeCountAfter", + "edgesAdded", + "totalFaceCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-capture-frame/SKILL.md b/.agent/skills/profiler-capture-frame/SKILL.md new file mode 100644 index 0000000..d11adc2 --- /dev/null +++ b/.agent/skills/profiler-capture-frame/SKILL.md @@ -0,0 +1,122 @@ +--- +name: profiler-capture-frame +description: Capture the current frame's timing info (delta time, FPS, frame counts, runtime). Snapshot only — historical frames live in Unity's Profiler window. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Capture Frame + +Reads `UnityEngine.Time` fields and returns them in a single struct. This tool is intentionally a single-frame snapshot — Unity's runtime API does not expose historical frame-data outside the Profiler window. + +## Fields + +- `FrameTimeMs` — `Time.deltaTime * 1000f`. +- `Fps` — `1 / Time.deltaTime` (0 when delta is zero). +- `TotalFrameCount` — `Time.frameCount` (includes skipped renders). +- `RealtimeSinceStartup` — `Time.realtimeSinceStartup`. +- `RenderedFrameCount` — `Time.renderedFrameCount`. + +## Behavior + +Uses only built-in Unity APIs (`UnityEngine.Time`). No external Unity package is required. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-capture-frame --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-capture-frame --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-capture-frame --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-FrameCaptureData", + "description": "Single-frame snapshot of timing information from UnityEngine.Time. No historical frame data; use the Profiler window for that." + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-FrameCaptureData": { + "type": "object", + "properties": { + "FrameTimeMs": { + "type": "number", + "description": "Time.deltaTime in milliseconds at the moment of capture." + }, + "Fps": { + "type": "number", + "description": "Frames per second derived from Time.deltaTime." + }, + "TotalFrameCount": { + "type": "integer", + "description": "Total frame count since application start (Time.frameCount). May include skipped renders." + }, + "RealtimeSinceStartup": { + "type": "number", + "description": "Time.realtimeSinceStartup, in seconds." + }, + "RenderedFrameCount": { + "type": "integer", + "description": "Frames actually rendered (Time.renderedFrameCount)." + } + }, + "required": [ + "FrameTimeMs", + "Fps", + "TotalFrameCount", + "RealtimeSinceStartup", + "RenderedFrameCount" + ], + "description": "Single-frame snapshot of timing information from UnityEngine.Time. No historical frame data; use the Profiler window for that." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-clear-data/SKILL.md b/.agent/skills/profiler-clear-data/SKILL.md new file mode 100644 index 0000000..dcc853a --- /dev/null +++ b/.agent/skills/profiler-clear-data/SKILL.md @@ -0,0 +1,78 @@ +--- +name: profiler-clear-data +description: Discard all frames currently held by the Editor Profiler (UnityEditorInternal.ProfilerDriver.ClearAllFrames). Cannot be undone. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Clear Data + +Invokes `UnityEditorInternal.ProfilerDriver.ClearAllFrames()` on the main thread. `UnityEditorInternal` is a built-in editor namespace — no external Unity package is required. + +## Behavior + +After this call, the Profiler window's frame history is empty; subsequent recording starts from frame 0. Returns `true` on success. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-clear-data --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-clear-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-clear-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "boolean" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-enable-module/SKILL.md b/.agent/skills/profiler-enable-module/SKILL.md new file mode 100644 index 0000000..da06d68 --- /dev/null +++ b/.agent/skills/profiler-enable-module/SKILL.md @@ -0,0 +1,91 @@ +--- +name: profiler-enable-module +description: Toggle the wrapper's local 'enabled' flag for a named profiler module. Bookkeeping only — Unity's runtime API does not expose direct module control; for real module visibility use the Profiler window. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Enable Module + +Adds or removes the given module name from the wrapper's `EnabledModules` set. This is local bookkeeping consumed by `profiler-get-status` and `profiler-list-modules`; Unity's runtime API does not allow programmatic toggling of Profiler-window modules from a built-in namespace, so this tool intentionally does not pretend to. + +## Inputs + +- `moduleName` (required) — one of the names returned by `profiler-list-modules`. +- `enabled` (default `true`) — set to `false` to mark the module disabled. + +## Errors + +- Returns an `[Error]` string when `moduleName` is empty or unknown. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-enable-module --input '{ + "moduleName": "string_value", + "enabled": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-enable-module --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-enable-module --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `moduleName` | `string` | Yes | Profiler module name (e.g. 'CPU', 'GPU', 'Memory'). | +| `enabled` | `boolean` | No | True to mark the module enabled in local bookkeeping; false to mark disabled. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "moduleName": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + }, + "required": [ + "moduleName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-get-memory-stats/SKILL.md b/.agent/skills/profiler-get-memory-stats/SKILL.md new file mode 100644 index 0000000..3a1a7da --- /dev/null +++ b/.agent/skills/profiler-get-memory-stats/SKILL.md @@ -0,0 +1,146 @@ +--- +name: profiler-get-memory-stats +description: Return memory statistics snapshot from UnityEngine.Profiling.Profiler — reserved, allocated, mono heap, graphics, etc. (in MB). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Get Memory Stats + +Reads UnityEngine.Profiling.Profiler scalar memory counters and converts each from bytes to megabytes (`/1048576f`). + +## Fields + +- `TotalReservedMemoryMB` — `GetTotalReservedMemoryLong()`. +- `TotalAllocatedMemoryMB` — `GetTotalAllocatedMemoryLong()`. +- `TotalUnusedReservedMemoryMB` — `GetTotalUnusedReservedMemoryLong()`. +- `MonoHeapSizeMB` — `GetMonoHeapSizeLong()`. +- `MonoUsedSizeMB` — `GetMonoUsedSizeLong()`. +- `TempAllocatorSizeMB` — `GetTempAllocatorSize()`. +- `GraphicsMemoryMB` — `GetAllocatedMemoryForGraphicsDriver()`. +- `MaxUsedMemoryMB` — `maxUsedMemory`. +- `UsedHeapSizeMB` — `usedHeapSizeLong`. + +## Behavior + +Uses only built-in Unity APIs (`UnityEngine.Profiling.Profiler`). No external Unity package is required. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-get-memory-stats --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-get-memory-stats --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-get-memory-stats --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-MemoryStatsData", + "description": "Memory statistics from the Unity Profiler. All values in megabytes unless otherwise noted." + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-MemoryStatsData": { + "type": "object", + "properties": { + "TotalReservedMemoryMB": { + "type": "number", + "description": "Total reserved memory (UnityEngine.Profiling.Profiler.GetTotalReservedMemoryLong / 1048576)." + }, + "TotalAllocatedMemoryMB": { + "type": "number", + "description": "Total allocated memory (UnityEngine.Profiling.Profiler.GetTotalAllocatedMemoryLong / 1048576)." + }, + "TotalUnusedReservedMemoryMB": { + "type": "number", + "description": "Total unused reserved memory (UnityEngine.Profiling.Profiler.GetTotalUnusedReservedMemoryLong / 1048576)." + }, + "MonoHeapSizeMB": { + "type": "number", + "description": "Mono heap size (UnityEngine.Profiling.Profiler.GetMonoHeapSizeLong / 1048576)." + }, + "MonoUsedSizeMB": { + "type": "number", + "description": "Mono used size (UnityEngine.Profiling.Profiler.GetMonoUsedSizeLong / 1048576)." + }, + "TempAllocatorSizeMB": { + "type": "number", + "description": "Temp allocator size (UnityEngine.Profiling.Profiler.GetTempAllocatorSize / 1048576)." + }, + "GraphicsMemoryMB": { + "type": "number", + "description": "Graphics memory reserved by the driver (UnityEngine.Profiling.Profiler.GetAllocatedMemoryForGraphicsDriver / 1048576)." + }, + "MaxUsedMemoryMB": { + "type": "number", + "description": "Maximum used memory observed (UnityEngine.Profiling.Profiler.maxUsedMemory / 1048576)." + }, + "UsedHeapSizeMB": { + "type": "number", + "description": "Used heap size (UnityEngine.Profiling.Profiler.usedHeapSizeLong / 1048576)." + } + }, + "required": [ + "TotalReservedMemoryMB", + "TotalAllocatedMemoryMB", + "TotalUnusedReservedMemoryMB", + "MonoHeapSizeMB", + "MonoUsedSizeMB", + "TempAllocatorSizeMB", + "GraphicsMemoryMB", + "MaxUsedMemoryMB", + "UsedHeapSizeMB" + ], + "description": "Memory statistics from the Unity Profiler. All values in megabytes unless otherwise noted." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-get-rendering-stats/SKILL.md b/.agent/skills/profiler-get-rendering-stats/SKILL.md new file mode 100644 index 0000000..5e58450 --- /dev/null +++ b/.agent/skills/profiler-get-rendering-stats/SKILL.md @@ -0,0 +1,122 @@ +--- +name: profiler-get-rendering-stats +description: Return current frame timing, FPS, vsync, target frame rate, threading mode, and graphics device type from Unity Time / QualitySettings / SystemInfo. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Get Rendering Stats + +Snapshots rendering-related fields from `UnityEngine.Time`, `UnityEngine.QualitySettings`, `UnityEngine.Application` and `UnityEngine.SystemInfo`. All values are read from built-in Unity APIs so no external Unity package is required. + +## Fields + +- `FrameTimeMs` — `Time.deltaTime * 1000f`. +- `Fps` — `1 / Time.deltaTime` (0 when delta is zero). +- `VSyncCount` — `QualitySettings.vSyncCount`. +- `TargetFrameRate` — `Application.targetFrameRate`. +- `RenderingThreadingMode` — `SystemInfo.renderingThreadingMode.ToString()`. +- `GraphicsDeviceType` — `SystemInfo.graphicsDeviceType.ToString()`. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-get-rendering-stats --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-get-rendering-stats --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-get-rendering-stats --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-RenderingStatsData", + "description": "Rendering statistics from Unity's Time / QualitySettings / SystemInfo. No external package required." + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-RenderingStatsData": { + "type": "object", + "properties": { + "FrameTimeMs": { + "type": "number", + "description": "Last reported frame time (Time.deltaTime * 1000) in milliseconds." + }, + "Fps": { + "type": "number", + "description": "Frames per second derived from Time.deltaTime." + }, + "VSyncCount": { + "type": "integer", + "description": "QualitySettings.vSyncCount." + }, + "TargetFrameRate": { + "type": "integer", + "description": "Application.targetFrameRate." + }, + "RenderingThreadingMode": { + "type": "string", + "description": "SystemInfo.renderingThreadingMode." + }, + "GraphicsDeviceType": { + "type": "string", + "description": "SystemInfo.graphicsDeviceType." + } + }, + "required": [ + "FrameTimeMs", + "Fps", + "VSyncCount", + "TargetFrameRate" + ], + "description": "Rendering statistics from Unity's Time / QualitySettings / SystemInfo. No external package required." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-get-script-stats/SKILL.md b/.agent/skills/profiler-get-script-stats/SKILL.md new file mode 100644 index 0000000..73e6de0 --- /dev/null +++ b/.agent/skills/profiler-get-script-stats/SKILL.md @@ -0,0 +1,130 @@ +--- +name: profiler-get-script-stats +description: Return script execution timing (frame time, fixed dt, time scale, frame count, runtime) plus Mono / GC memory usage in MB. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Get Script Stats + +Snapshots fields from `UnityEngine.Time`, `UnityEngine.Profiling.Profiler.GetMonoUsedSizeLong()` and `System.GC.GetTotalMemory(false)`. All values are produced by built-in Unity APIs. + +## Fields + +- `FrameTimeMs` — `Time.deltaTime * 1000f`. +- `FixedDeltaTimeMs` — `Time.fixedDeltaTime * 1000f`. +- `TimeScale` — `Time.timeScale`. +- `TotalFrameCount` — `Time.frameCount`. +- `RealtimeSinceStartup` — `Time.realtimeSinceStartup`. +- `MonoMemoryUsageMB` — `Profiler.GetMonoUsedSizeLong() / 1048576f`. +- `GCMemoryUsageMB` — `GC.GetTotalMemory(false) / 1048576f`. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-get-script-stats --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-get-script-stats --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-get-script-stats --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ScriptStatsData", + "description": "Script statistics derived from UnityEngine.Time + UnityEngine.Profiling.Profiler." + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ScriptStatsData": { + "type": "object", + "properties": { + "FrameTimeMs": { + "type": "number", + "description": "Time.deltaTime in milliseconds." + }, + "FixedDeltaTimeMs": { + "type": "number", + "description": "Time.fixedDeltaTime in milliseconds." + }, + "TimeScale": { + "type": "number", + "description": "Time.timeScale." + }, + "TotalFrameCount": { + "type": "integer", + "description": "Total frame count since application start (Time.frameCount)." + }, + "RealtimeSinceStartup": { + "type": "number", + "description": "Time.realtimeSinceStartup, in seconds." + }, + "MonoMemoryUsageMB": { + "type": "number", + "description": "Mono used size (Profiler.GetMonoUsedSizeLong / 1048576), in megabytes." + }, + "GCMemoryUsageMB": { + "type": "number", + "description": "System.GC.GetTotalMemory(false) / 1048576, in megabytes." + } + }, + "required": [ + "FrameTimeMs", + "FixedDeltaTimeMs", + "TimeScale", + "TotalFrameCount", + "RealtimeSinceStartup", + "MonoMemoryUsageMB", + "GCMemoryUsageMB" + ], + "description": "Script statistics derived from UnityEngine.Time + UnityEngine.Profiling.Profiler." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-get-status/SKILL.md b/.agent/skills/profiler-get-status/SKILL.md new file mode 100644 index 0000000..ebaf681 --- /dev/null +++ b/.agent/skills/profiler-get-status/SKILL.md @@ -0,0 +1,121 @@ +--- +name: profiler-get-status +description: Return the Unity profiler's current enabled state, active modules, max-used memory, and platform support flag. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Get Status + +Snapshots `UnityEngine.Profiling.Profiler` state and returns it in a single response. + +## Fields + +- `ProfilerEnabled` — `Profiler.enabled`. +- `ActiveModules` — names of modules this wrapper considers enabled (local bookkeeping). +- `MaxUsedMemoryMB` — `Profiler.maxUsedMemory / 1048576f`. +- `Supported` — `Profiler.supported`. + +## Behavior + +Uses only built-in Unity APIs. No external Unity package is required. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-get-status --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-get-status --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-get-status --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerStatusData", + "description": "Profiler status data including memory and module information." + } + }, + "$defs": { + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerStatusData": { + "type": "object", + "properties": { + "ProfilerEnabled": { + "type": "boolean", + "description": "Whether Unity's runtime profiler is currently enabled (UnityEngine.Profiling.Profiler.enabled)." + }, + "ActiveModules": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)", + "description": "List of profiler modules this wrapper considers active. Local bookkeeping only." + }, + "MaxUsedMemoryMB": { + "type": "number", + "description": "Maximum used memory recorded by the profiler, in megabytes." + }, + "Supported": { + "type": "boolean", + "description": "Whether profiling is supported on this platform (UnityEngine.Profiling.Profiler.supported)." + } + }, + "required": [ + "ProfilerEnabled", + "MaxUsedMemoryMB", + "Supported" + ], + "description": "Profiler status data including memory and module information." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-list-modules/SKILL.md b/.agent/skills/profiler-list-modules/SKILL.md new file mode 100644 index 0000000..d126cb0 --- /dev/null +++ b/.agent/skills/profiler-list-modules/SKILL.md @@ -0,0 +1,115 @@ +--- +name: profiler-list-modules +description: List all known profiler module names with their local 'enabled' bookkeeping flag. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / List Modules + +Returns `Tool_Profiler.AvailableModules` projected into a `ProfilerModulesData` list, with each entry's `Enabled` field reflecting the wrapper's local bookkeeping. + +## Behavior + +Uses only built-in Unity APIs and in-process state. No external Unity package is required. Pair with `profiler-enable-module` to flip the bookkeeping flag. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-list-modules --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-list-modules --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-list-modules --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModulesData", + "description": "Container for 'profiler-list-modules' output." + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo", + "description": "Profiler module entry returned by 'profiler-list-modules'." + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Module name (e.g. 'CPU', 'Memory')." + }, + "Enabled": { + "type": "boolean", + "description": "Whether the wrapper considers this module enabled. Local bookkeeping only." + } + }, + "required": [ + "Enabled" + ], + "description": "Profiler module entry returned by 'profiler-list-modules'." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModulesData": { + "type": "object", + "properties": { + "Modules": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo)", + "description": "All known profiler modules and their wrapper-side enabled flag." + } + }, + "description": "Container for 'profiler-list-modules' output." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-load-data/SKILL.md b/.agent/skills/profiler-load-data/SKILL.md new file mode 100644 index 0000000..42f2ffa --- /dev/null +++ b/.agent/skills/profiler-load-data/SKILL.md @@ -0,0 +1,89 @@ +--- +name: profiler-load-data +description: Read back a previously-saved JSON snapshot from `profiler-save-data` and return its raw text. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Load Data + +Reads `filePath` as UTF-8 text and returns the file body unchanged. Caller is responsible for parsing. + +## Inputs + +- `filePath` (required) — path written by `profiler-save-data`. + +## Errors + +- Returns `[Error]` when `filePath` is empty, the file does not exist, exceeds the 10 MB size cap, or the read fails. + +## Behavior + +Uses `System.IO.File.ReadAllText` (BCL) — no external Unity package is required. Files larger than 10 MB are rejected up-front to avoid OOM on a stray call. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-load-data --input '{ + "filePath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-load-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-load-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filePath` | `string` | Yes | Path to a profiler snapshot file previously written by 'profiler-save-data'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filePath": { + "type": "string" + } + }, + "required": [ + "filePath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-save-data/SKILL.md b/.agent/skills/profiler-save-data/SKILL.md new file mode 100644 index 0000000..c6dbae1 --- /dev/null +++ b/.agent/skills/profiler-save-data/SKILL.md @@ -0,0 +1,89 @@ +--- +name: profiler-save-data +description: Save a snapshot of profiler-derived stats (status + memory + rendering + script + frame capture) to a JSON file. Built-in Unity APIs only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Save Data + +Composes the outputs of `profiler-get-status`, `profiler-get-memory-stats`, `profiler-get-rendering-stats`, `profiler-get-script-stats` and `profiler-capture-frame` into a single JSON document and writes it to `filePath`. Creates any missing parent directories. + +## Inputs + +- `filePath` (required) — absolute or workspace-relative path to write to. + +## Errors + +- Returns `[Error]` when `filePath` is empty or the write fails (message includes the underlying exception text). + +## Behavior + +Uses `System.Text.Json` (BCL) for serialization and `System.IO.File.WriteAllText` for the write. No external Unity package is required. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-save-data --input '{ + "filePath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-save-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-save-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filePath` | `string` | Yes | Absolute or workspace-relative output file path. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filePath": { + "type": "string" + } + }, + "required": [ + "filePath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-start/SKILL.md b/.agent/skills/profiler-start/SKILL.md new file mode 100644 index 0000000..9a86e9c --- /dev/null +++ b/.agent/skills/profiler-start/SKILL.md @@ -0,0 +1,80 @@ +--- +name: profiler-start +description: "Enable Unity's runtime profiler and open the Profiler window. Idempotent: calling when already enabled returns the current enabled state without error." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Start + +Enables `UnityEngine.Profiling.Profiler.enabled = true` and opens `Window > Analysis > Profiler` via `EditorApplication.ExecuteMenuItem`. Returns `true` once the profiler is enabled. + +## Behavior + +Uses only built-in Unity APIs (`UnityEngine.Profiling`, `UnityEditor.EditorApplication`). No external Unity package is required. + +Snapshot-based: this tool does not stream historical frame data — use Unity's Profiler window directly for that. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-start --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-start --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-start --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "boolean" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/profiler-stop/SKILL.md b/.agent/skills/profiler-stop/SKILL.md new file mode 100644 index 0000000..c19930d --- /dev/null +++ b/.agent/skills/profiler-stop/SKILL.md @@ -0,0 +1,78 @@ +--- +name: profiler-stop +description: Disable Unity's runtime profiler. Idempotent — calling when already disabled returns the current disabled state. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Profiler / Stop + +Sets `UnityEngine.Profiling.Profiler.enabled = false`. Returns the post-call value of `Profiler.enabled` (expected `false`). + +## Behavior + +Uses only built-in Unity APIs (`UnityEngine.Profiling`). No external Unity package is required. + +## How to Call + +```bash +unity-mcp-cli run-tool profiler-stop --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool profiler-stop --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool profiler-stop --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "boolean" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/reflection-method-call/SKILL.md b/.agent/skills/reflection-method-call/SKILL.md new file mode 100644 index 0000000..2eb4e4c --- /dev/null +++ b/.agent/skills/reflection-method-call/SKILL.md @@ -0,0 +1,254 @@ +--- +name: reflection-method-call +description: Call a C# method by reflection — including private methods. Requires a method schema obtained via 'reflection-method-find'. Supports static methods, instance methods (with optional target deserialization), and main-thread / off-thread execution. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Method C# / Call + +Call C# method. Any method could be called, even private methods. It requires to receive proper method schema. Use 'reflection-method-find' to find available method before using it. Receives input parameters and returns result. + +## Match levels (apply to `typeName`, `MethodName`, `Parameters`) + +- `typeNameMatchLevel` / `methodNameMatchLevel` (default 1 — contains ignoring case): `0` ignore filter, `1` contains-ic, `2` contains-cs, `3` starts-with-ic, `4` starts-with-cs, `5` equals-ic, `6` equals-cs. +- `parametersMatchLevel` (default 2 — equals): `0` ignore filter, `1` count matches, `2` equals. + +## Inputs + +- `targetObject` (optional) — for instance methods. When null, a new instance is created from the declaring type. Required shape: `{ type, value }` (value is deserialized to `type`). +- `inputParameters` (optional) — list of `{ type, name, value }`. Names are enhanced against the resolved method signature if omitted. +- `executeInMainThread` (default `true`) — Unity API calls should keep this true; set false only for thread-safe pure logic. + +## How to Call + +```bash +unity-mcp-cli run-tool reflection-method-call --input '{ + "filter": "string_value", + "knownNamespace": false, + "typeNameMatchLevel": 0, + "methodNameMatchLevel": 0, + "parametersMatchLevel": 0, + "targetObject": "string_value", + "inputParameters": "string_value", + "executeInMainThread": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool reflection-method-call --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool reflection-method-call --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filter` | `any` | Yes | Method reference. Used to find method in codebase of the project. | +| `knownNamespace` | `boolean` | No | Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false. | +| `typeNameMatchLevel` | `integer` | No | Minimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | +| `methodNameMatchLevel` | `integer` | No | Minimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | +| `parametersMatchLevel` | `integer` | No | Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters', 1 - parameters count is the same, 2 - equals (default value). | +| `targetObject` | `any` | No | Specify target object to call method on. Should be null if the method is static or if there is no specific target instance. New instance of the specified class will be created if the method is instance method and the targetObject is null. Required: type - full type name of the object to call method on, value - serialized object value (it will be deserialized to the specified type). | +| `inputParameters` | `any` | No | Method input parameters. Per each parameter specify: type - full type name of the object to call method on, name - parameter name, value - serialized object value (it will be deserialized to the specified type). | +| `executeInMainThread` | `boolean` | No | Set to true if the method should be executed in the main thread. Otherwise, set to false. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filter": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef" + }, + "knownNamespace": { + "type": "boolean" + }, + "typeNameMatchLevel": { + "type": "integer" + }, + "methodNameMatchLevel": { + "type": "integer" + }, + "parametersMatchLevel": { + "type": "integer" + }, + "targetObject": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "inputParameters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList" + }, + "executeInMainThread": { + "type": "boolean" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter", + "description": "Parameter of a method. Contains type and name of the parameter." + } + }, + "com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Type of the parameter including namespace. Sample: 'System.String', 'System.Int32', 'UnityEngine.GameObject', etc." + }, + "name": { + "type": "string", + "description": "Name of the parameter. It may be empty if the name is unknown." + } + }, + "description": "Parameter of a method. Contains type and name of the parameter." + }, + "com.IvanMurzak.ReflectorNet.Model.MethodRef": { + "type": "object", + "properties": { + "namespace": { + "type": "string", + "description": "Namespace of the class. It may be empty if the class is in the global namespace or the namespace is unknown." + }, + "typeName": { + "type": "string", + "description": "Class name, or substring a class name. It may be empty if the class is unknown." + }, + "methodName": { + "type": "string", + "description": "Method name, or substring of the method name. It may be empty if the method is unknown." + }, + "inputParameters": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)", + "description": "List of input parameters. Can be null if the method has no parameters or the parameters are unknown." + } + }, + "description": "Method reference. Used to find method in codebase of the project." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "filter" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/reflection-method-find/SKILL.md b/.agent/skills/reflection-method-find/SKILL.md new file mode 100644 index 0000000..f23dcdb --- /dev/null +++ b/.agent/skills/reflection-method-find/SKILL.md @@ -0,0 +1,151 @@ +--- +name: reflection-method-find +description: Find C# methods across every loaded assembly by name / type / parameters — including private methods. Returns serialized `MethodData` entries usable as schemas for 'reflection-method-call'. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Method C# / Find + +Find method in the project using C# Reflection. It looks for all assemblies in the project and finds method by its name, class name and parameters. Even private methods are available. Use 'reflection-method-call' to call the method after finding it. + +## Match levels (apply to `typeName`, `MethodName`, `Parameters`) + +- `typeNameMatchLevel` / `methodNameMatchLevel` (default 1 — contains ignoring case): `0` ignore filter, `1` contains-ic, `2` contains-cs, `3` starts-with-ic, `4` starts-with-cs, `5` equals-ic, `6` equals-cs. +- `parametersMatchLevel` (default 0 — ignore filter): `0` ignore, `1` count matches, `2` equals. + +## Output + +On match, returns a `[Success] Found N method(s):` line followed by a JSON dump of every method's `MethodData`. Pass any single entry to 'reflection-method-call' as its `filter`. + +## How to Call + +```bash +unity-mcp-cli run-tool reflection-method-find --input '{ + "filter": "string_value", + "knownNamespace": false, + "typeNameMatchLevel": 0, + "methodNameMatchLevel": 0, + "parametersMatchLevel": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool reflection-method-find --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool reflection-method-find --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filter` | `any` | Yes | Method reference. Used to find method in codebase of the project. | +| `knownNamespace` | `boolean` | No | Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false. | +| `typeNameMatchLevel` | `integer` | No | Minimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | +| `methodNameMatchLevel` | `integer` | No | Minimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. | +| `parametersMatchLevel` | `integer` | No | Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters' (default value), 1 - parameters count is the same, 2 - equals. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filter": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef" + }, + "knownNamespace": { + "type": "boolean" + }, + "typeNameMatchLevel": { + "type": "integer" + }, + "methodNameMatchLevel": { + "type": "integer" + }, + "parametersMatchLevel": { + "type": "integer" + } + }, + "$defs": { + "System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter", + "description": "Parameter of a method. Contains type and name of the parameter." + } + }, + "com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Type of the parameter including namespace. Sample: 'System.String', 'System.Int32', 'UnityEngine.GameObject', etc." + }, + "name": { + "type": "string", + "description": "Name of the parameter. It may be empty if the name is unknown." + } + }, + "description": "Parameter of a method. Contains type and name of the parameter." + }, + "com.IvanMurzak.ReflectorNet.Model.MethodRef": { + "type": "object", + "properties": { + "namespace": { + "type": "string", + "description": "Namespace of the class. It may be empty if the class is in the global namespace or the namespace is unknown." + }, + "typeName": { + "type": "string", + "description": "Class name, or substring a class name. It may be empty if the class is unknown." + }, + "methodName": { + "type": "string", + "description": "Method name, or substring of the method name. It may be empty if the method is unknown." + }, + "inputParameters": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)", + "description": "List of input parameters. Can be null if the method has no parameters or the parameters are unknown." + } + }, + "description": "Method reference. Used to find method in codebase of the project." + } + }, + "required": [ + "filter" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-create/SKILL.md b/.agent/skills/scene-create/SKILL.md new file mode 100644 index 0000000..7c0fa2e --- /dev/null +++ b/.agent/skills/scene-create/SKILL.md @@ -0,0 +1,166 @@ +--- +name: scene-create +description: Create a new Unity scene asset and save it at the given `.unity` path. Use 'scene-list-opened' to inspect the resulting opened-scene set afterwards. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Create + +Create new scene in the project assets. Use 'scene-list-opened' tool to list all opened scenes after creation. + +## Inputs + +- `path` — must end with `.unity`. Non-empty. +- `newSceneSetup` (default `DefaultGameObjects`) — Unity's `NewSceneSetup` flag (`EmptyScene` or `DefaultGameObjects`). +- `newSceneMode` (default `Single`) — `Single` closes other scenes, `Additive` keeps them open. + +## Behavior + +Calls `EditorSceneManager.NewScene` + `SaveScene(path)` on the main thread, repaints editor windows, and returns a `SceneDataShallow` for the newly created scene. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-create --input '{ + "path": "string_value", + "newSceneSetup": "string_value", + "newSceneMode": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `path` | `string` | Yes | Path to the scene file. Should end with ".unity" extension. | +| `newSceneSetup` | `any` | No | | +| `newSceneMode` | `any` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "newSceneSetup": { + "$ref": "#/$defs/UnityEditor.SceneManagement.NewSceneSetup" + }, + "newSceneMode": { + "$ref": "#/$defs/UnityEditor.SceneManagement.NewSceneMode" + } + }, + "$defs": { + "UnityEditor.SceneManagement.NewSceneSetup": { + "type": "string", + "enum": [ + "EmptyScene", + "DefaultGameObjects" + ] + }, + "UnityEditor.SceneManagement.NewSceneMode": { + "type": "string", + "enum": [ + "Single", + "Additive" + ] + } + }, + "required": [ + "path" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SceneDataShallow", + "description": "Scene reference. Used to find a Scene." + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.SceneDataShallow": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "IsLoaded": { + "type": "boolean" + }, + "IsDirty": { + "type": "boolean" + }, + "IsSubScene": { + "type": "boolean" + }, + "IsValidScene": { + "type": "boolean", + "description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid." + }, + "RootCount": { + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the Scene within the project. Starts with 'Assets/'" + }, + "buildIndex": { + "type": "integer", + "description": "Build index of the Scene in the Build Settings." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "IsLoaded", + "IsDirty", + "IsSubScene", + "IsValidScene", + "RootCount", + "buildIndex", + "instanceID" + ], + "description": "Scene reference. Used to find a Scene." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-get-data/SKILL.md b/.agent/skills/scene-get-data/SKILL.md new file mode 100644 index 0000000..48f5f21 --- /dev/null +++ b/.agent/skills/scene-get-data/SKILL.md @@ -0,0 +1,437 @@ +--- +name: scene-get-data +description: Retrieve the list of root GameObjects in the specified opened scene (or the active scene when `openedSceneName` is empty). Supports token-saving path-scoped reads over the root-GameObjects array via `paths` or `viewQuery`. Use 'scene-list-opened' to enumerate scenes. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Get Data + +This tool retrieves the list of root GameObjects in the specified scene. Use 'scene-list-opened' tool to get the list of all opened scenes. + +## Toggles (all default `false` to keep responses small) + +- `includeRootGameObjects` — include root GameObjects in the scene data. +- `includeChildrenDepth` (default 3) — depth of the hierarchy to include. +- `includeBounds` — include 3D bounds for GameObjects. +- `includeData` — include serialized component data for GameObjects. + +## Path-scoped reads (token-saving) + +Supply `paths` to read only the listed fields/elements from the scene's root-GameObjects array via `Reflector.TryReadAt`, or `viewQuery` to navigate/filter the same array via `Reflector.View`. The result populates `Data` on the returned `SceneData`. These two parameters are mutually exclusive. + +## Path syntax + +`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. Example: `paths=['[0]/name']` reads the name of the first root GameObject. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-get-data --input '{ + "openedSceneName": "string_value", + "includeRootGameObjects": false, + "includeChildrenDepth": 0, + "includeBounds": false, + "includeData": false, + "paths": "string_value", + "viewQuery": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-get-data --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-get-data --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `openedSceneName` | `string` | No | Name of the opened scene. If empty or null, the active scene will be used. | +| `includeRootGameObjects` | `boolean` | No | If true, includes root GameObjects in the scene data. | +| `includeChildrenDepth` | `integer` | No | Determines the depth of the hierarchy to include. | +| `includeBounds` | `boolean` | No | If true, includes bounding box information for GameObjects. | +| `includeData` | `boolean` | No | If true, includes component data for GameObjects. | +| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt against the scene's root-GameObjects array. Path syntax: 'fieldName', '[i]/field', '[i]/component/[j]/property'. Mutually exclusive with 'viewQuery'. | +| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View on the scene's root-GameObjects array. Mutually exclusive with 'paths'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "openedSceneName": { + "type": "string" + }, + "includeRootGameObjects": { + "type": "boolean" + }, + "includeChildrenDepth": { + "type": "integer" + }, + "includeBounds": { + "type": "boolean" + }, + "includeData": { + "type": "boolean" + }, + "paths": { + "$ref": "#/$defs/System.Collections.Generic.List(System.String)" + }, + "viewQuery": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery" + } + }, + "$defs": { + "System.Collections.Generic.List(System.String)": { + "type": "array", + "items": { + "type": "string" + } + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.ReflectorNet.Model.ViewQuery": { + "type": "object", + "properties": { + "Path": { + "type": "string", + "description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object." + }, + "NamePattern": { + "type": "string", + "description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering." + }, + "MaxDepth": { + "type": "integer", + "description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth." + }, + "TypeFilter": { + "$ref": "#/$defs/System.Type", + "description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type." + } + } + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SceneData", + "description": "Scene reference. Used to find a Scene." + } + }, + "$defs": { + "System.Collections.Generic.List(AIGD.GameObjectData)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectData" + } + }, + "AIGD.GameObjectData": { + "type": "object", + "properties": { + "Reference": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "Data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "GameObject editable data (tag, layer, etc)." + }, + "Bounds": { + "$ref": "#/$defs/UnityEngine.Bounds", + "description": "Bounds of the GameObject." + }, + "Hierarchy": { + "$ref": "#/$defs/AIGD.GameObjectMetadata", + "description": "Hierarchy metadata of the GameObject." + }, + "Components": { + "$ref": "#/$defs/AIGD.ComponentDataShallow-1", + "description": "Attached components shallow data of the GameObject (Read-only, use Component modification tool for modification)." + } + } + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "UnityEngine.Bounds": { + "type": "object", + "properties": { + "center": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ] + }, + "size": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ] + } + }, + "required": [ + "center", + "size" + ], + "additionalProperties": false + }, + "AIGD.GameObjectMetadata": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sceneName": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "activeSelf": { + "type": "boolean" + }, + "activeInHierarchy": { + "type": "boolean" + }, + "children": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectMetadata)" + } + }, + "required": [ + "instanceID", + "activeSelf", + "activeInHierarchy" + ] + }, + "System.Collections.Generic.List(AIGD.GameObjectMetadata)": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectMetadata" + } + }, + "AIGD.ComponentDataShallow-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ComponentDataShallow" + } + }, + "AIGD.ComponentDataShallow": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "typeName": { + "type": "string" + }, + "isEnabled": { + "type": "string", + "enum": [ + "False", + "True", + "NA" + ] + } + }, + "required": [ + "instanceID", + "isEnabled" + ] + }, + "AIGD.SceneData": { + "type": "object", + "properties": { + "RootGameObjects": { + "$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectData)" + }, + "Data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' is supplied to the scene-get-data tool. Null otherwise." + }, + "Name": { + "type": "string" + }, + "IsLoaded": { + "type": "boolean" + }, + "IsDirty": { + "type": "boolean" + }, + "IsSubScene": { + "type": "boolean" + }, + "IsValidScene": { + "type": "boolean", + "description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid." + }, + "RootCount": { + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the Scene within the project. Starts with 'Assets/'" + }, + "buildIndex": { + "type": "integer", + "description": "Build index of the Scene in the Build Settings." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "IsLoaded", + "IsDirty", + "IsSubScene", + "IsValidScene", + "RootCount", + "buildIndex", + "instanceID" + ], + "description": "Scene reference. Used to find a Scene." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-list-opened/SKILL.md b/.agent/skills/scene-list-opened/SKILL.md new file mode 100644 index 0000000..6500353 --- /dev/null +++ b/.agent/skills/scene-list-opened/SKILL.md @@ -0,0 +1,137 @@ +--- +name: scene-list-opened +description: List every scene currently opened in the Unity Editor as a shallow snapshot (name, path, build flags). Use 'scene-get-data' for the deep view of a specific scene. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / List Opened + +Returns the list of currently opened scenes in Unity Editor. Use 'scene-get-data' tool to get detailed information about a specific scene. + +## Behavior + +Maps `OpenedScenes` through `ToSceneDataShallow()` on the main thread and returns the resulting array. No filtering or pagination — every opened scene is included. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-list-opened --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-list-opened --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-list-opened --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SceneDataShallow-1" + } + }, + "$defs": { + "AIGD.SceneDataShallow": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "IsLoaded": { + "type": "boolean" + }, + "IsDirty": { + "type": "boolean" + }, + "IsSubScene": { + "type": "boolean" + }, + "IsValidScene": { + "type": "boolean", + "description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid." + }, + "RootCount": { + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the Scene within the project. Starts with 'Assets/'" + }, + "buildIndex": { + "type": "integer", + "description": "Build index of the Scene in the Build Settings." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "IsLoaded", + "IsDirty", + "IsSubScene", + "IsValidScene", + "RootCount", + "buildIndex", + "instanceID" + ], + "description": "Scene reference. Used to find a Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.SceneDataShallow-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.SceneDataShallow", + "description": "Scene reference. Used to find a Scene." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-open/SKILL.md b/.agent/skills/scene-open/SKILL.md new file mode 100644 index 0000000..8f29183 --- /dev/null +++ b/.agent/skills/scene-open/SKILL.md @@ -0,0 +1,187 @@ +--- +name: scene-open +description: Open a Unity scene asset in Single or Additive mode. Returns the post-open list of all opened scenes. Use 'assets-find' to locate the scene asset first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Open + +Open scene from the project asset file. Use 'assets-find' tool to find the scene asset first. + +## Inputs + +- `sceneRef` — `AssetObjectRef` pointing at a `SceneAsset`. Throws if the asset cannot be resolved or is not a `SceneAsset`. +- `loadSceneMode` (default `Single`): + - `Single` — closes the currently opened scenes and opens this one. + - `Additive` — keeps the currently opened scenes and opens this one alongside them. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-open --input '{ + "sceneRef": "string_value", + "loadSceneMode": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-open --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-open --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sceneRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. | +| `loadSceneMode` | `string` | No | Open scene mode. Single: closes the current scenes and opens a new one. Additive: keeps the current scene and opens additional one. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sceneRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + }, + "loadSceneMode": { + "type": "string", + "enum": [ + "Single", + "Additive", + "AdditiveWithoutLoading" + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "sceneRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SceneDataShallow-1" + } + }, + "$defs": { + "AIGD.SceneDataShallow": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "IsLoaded": { + "type": "boolean" + }, + "IsDirty": { + "type": "boolean" + }, + "IsSubScene": { + "type": "boolean" + }, + "IsValidScene": { + "type": "boolean", + "description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid." + }, + "RootCount": { + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the Scene within the project. Starts with 'Assets/'" + }, + "buildIndex": { + "type": "integer", + "description": "Build index of the Scene in the Build Settings." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "IsLoaded", + "IsDirty", + "IsSubScene", + "IsValidScene", + "RootCount", + "buildIndex", + "instanceID" + ], + "description": "Scene reference. Used to find a Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.SceneDataShallow-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.SceneDataShallow", + "description": "Scene reference. Used to find a Scene." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-save/SKILL.md b/.agent/skills/scene-save/SKILL.md new file mode 100644 index 0000000..181218d --- /dev/null +++ b/.agent/skills/scene-save/SKILL.md @@ -0,0 +1,74 @@ +--- +name: scene-save +description: Save an opened scene back to its asset file (or to a new path when `path` is provided). When `openedSceneName` is empty, saves the currently active scene. Use 'scene-list-opened' to find the scene name first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Save + +Save Opened scene to the asset file. Use 'scene-list-opened' tool to get the list of all opened scenes. + +## Inputs + +- `openedSceneName` (optional) — name of an opened scene to save. Empty/null = active scene. +- `path` (optional) — destination `.unity` path. Empty/null = save back to the scene's existing path. + +## Validation + +Throws if the scene cannot be resolved, has no existing path AND no override path was supplied, or the supplied path does not end with `.unity`. On `EditorSceneManager.SaveScene` failure, surfaces an error with the current opened-scenes list for diagnosis. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-save --input '{ + "openedSceneName": "string_value", + "path": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-save --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-save --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `openedSceneName` | `string` | No | Name of the opened scene that should be saved. Could be empty if need to save the current active scene. | +| `path` | `string` | No | Path to the scene file. Should end with ".unity". If null or empty save to the existed scene asset file. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "openedSceneName": { + "type": "string" + }, + "path": { + "type": "string" + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/scene-set-active/SKILL.md b/.agent/skills/scene-set-active/SKILL.md new file mode 100644 index 0000000..54897b0 --- /dev/null +++ b/.agent/skills/scene-set-active/SKILL.md @@ -0,0 +1,178 @@ +--- +name: scene-set-active +description: Mark an opened scene as the Editor's active scene (the one new GameObjects are added to and that's used as the default for many operations). Use 'scene-list-opened' to enumerate opened scenes first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Set Active + +Set the specified opened scene as the active scene. Use 'scene-list-opened' tool to get the list of all opened scenes. + +## Inputs + +- `sceneRef` — `AssetObjectRef` pointing at a `SceneAsset`. The scene must already be opened. + +## Behavior + +Resolves the `SceneAsset`, finds the matching opened scene (by name then by path), and calls `EditorSceneManager.SetActiveScene`. No-op if the scene is already active. Returns the post-call snapshot of opened scenes. + +## How to Call + +```bash +unity-mcp-cli run-tool scene-set-active --input '{ + "sceneRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-set-active --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-set-active --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `sceneRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "sceneRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + } + }, + "required": [ + "sceneRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.SceneDataShallow-1" + } + }, + "$defs": { + "AIGD.SceneDataShallow": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "IsLoaded": { + "type": "boolean" + }, + "IsDirty": { + "type": "boolean" + }, + "IsSubScene": { + "type": "boolean" + }, + "IsValidScene": { + "type": "boolean", + "description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid." + }, + "RootCount": { + "type": "integer" + }, + "path": { + "type": "string", + "description": "Path to the Scene within the project. Starts with 'Assets/'" + }, + "buildIndex": { + "type": "integer", + "description": "Build index of the Scene in the Build Settings." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "IsLoaded", + "IsDirty", + "IsSubScene", + "IsValidScene", + "RootCount", + "buildIndex", + "instanceID" + ], + "description": "Scene reference. Used to find a Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "AIGD.SceneDataShallow-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.SceneDataShallow", + "description": "Scene reference. Used to find a Scene." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/scene-unload/SKILL.md b/.agent/skills/scene-unload/SKILL.md new file mode 100644 index 0000000..7d084dc --- /dev/null +++ b/.agent/skills/scene-unload/SKILL.md @@ -0,0 +1,132 @@ +--- +name: scene-unload +description: Unload an opened scene from the Unity Editor (asynchronously via `SceneManager.UnloadSceneAsync`). Use 'scene-list-opened' to find the scene name first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Scene / Unload + +Unload scene from the Opened scenes in Unity Editor. Use 'scene-list-opened' tool to get the list of all opened scenes. + +## Inputs + +- `name` — required non-empty scene name. Must match an opened scene; otherwise throws. + +## Behavior + +Runs `SceneManager.UnloadSceneAsync` on the main thread and awaits completion. Returns an `UnloadSceneResult` containing the scene name and an `AssetObjectRef` to its asset (or `null` if the scene was not backed by an asset on disk). + +## How to Call + +```bash +unity-mcp-cli run-tool scene-unload --input '{ + "name": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool scene-unload --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool scene-unload --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | Yes | Name of the loaded scene. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.UnloadSceneResult" + } + }, + "$defs": { + "AIGD.AssetObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.UnloadSceneResult": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the unloaded scene." + }, + "AssetObjectRef": { + "$ref": "#/$defs/AIGD.AssetObjectRef", + "description": "Reference to the unloaded scene asset." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/screenshot-camera/SKILL.md b/.agent/skills/screenshot-camera/SKILL.md new file mode 100644 index 0000000..d09e837 --- /dev/null +++ b/.agent/skills/screenshot-camera/SKILL.md @@ -0,0 +1,121 @@ +--- +name: screenshot-camera +description: Capture a screenshot from a Unity `Camera` and return it as a PNG image for direct LLM inspection. Falls back to `Camera.main` (then any active camera) when `cameraRef` is null. Width and height are capped to keep response size manageable. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Screenshot / Camera + +Captures a screenshot from a camera and returns it as an image. If no camera is specified, uses the Main Camera. Returns the image directly for visual inspection by the LLM. + +## Inputs + +- `cameraRef` (optional) — reference to a GameObject hosting a `Camera`. When null, `Camera.main` is used; if there is no main camera, the first entry of `Camera.allCameras` is used. +- `width` (default 1920) / `height` (default 1080) — output pixels. Must be > 0 and ≤ `MaxDimension`. + +## Behavior + +Allocates a temporary `RenderTexture`, swaps it onto the chosen camera, calls `Camera.Render`, reads back via `Texture2D.ReadPixels`, encodes as PNG, and restores the camera's prior `targetTexture`. Returns a `ResponseCallTool.Image` with `image/png` MIME and a descriptive caption. + +## How to Call + +```bash +unity-mcp-cli run-tool screenshot-camera --input '{ + "cameraRef": "string_value", + "width": 0, + "height": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool screenshot-camera --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool screenshot-camera --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `cameraRef` | `any` | No | Reference to the camera GameObject. If not specified, uses the Main Camera. | +| `width` | `integer` | No | Width of the screenshot in pixels. | +| `height` | `integer` | No | Height of the screenshot in pixels. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "cameraRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/screenshot-game-view/SKILL.md b/.agent/skills/screenshot-game-view/SKILL.md new file mode 100644 index 0000000..5483918 --- /dev/null +++ b/.agent/skills/screenshot-game-view/SKILL.md @@ -0,0 +1,64 @@ +--- +name: screenshot-game-view +description: Capture a screenshot of the Unity Editor's Game View by reading its internal render texture directly. Image size matches the current Game View resolution; the tool corrects Y-flip on DirectX / Metal so the output is always upright. Requires an open Game View window. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Screenshot / Game View + +Captures a screenshot from the Unity Editor Game View and returns it as an image. Reads the Game View's own render texture directly via the Unity Editor API. The image size matches the current Game View resolution. Returns the image directly for visual inspection by the LLM. + +## Behavior + +Locates `UnityEditor.GameView`, repaints it, then reflects the `m_RenderTexture` field and reads back via `Texture2D.ReadPixels`. On graphics APIs whose UV origin is top-left (`SystemInfo.graphicsUVStartsAtTop`), the read-back pixels are vertically flipped before encoding so the orientation matches what the user sees. Returns a PNG image with the resolution baked into the caption. + +## How to Call + +```bash +unity-mcp-cli run-tool screenshot-game-view --input '{ + "nothing": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool screenshot-game-view --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool screenshot-game-view --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `nothing` | `string` | No | | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "nothing": { + "type": "string" + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/screenshot-isolated/SKILL.md b/.agent/skills/screenshot-isolated/SKILL.md new file mode 100644 index 0000000..8ae3dc0 --- /dev/null +++ b/.agent/skills/screenshot-isolated/SKILL.md @@ -0,0 +1,207 @@ +--- +name: screenshot-isolated +description: Render a target GameObject from a chosen camera angle with optional layer-based isolation, configurable background (solid/skybox/transparent), multi-light setup via JSON, and Composite (2x2 Front/Right/Back/Top) mode. Returns a PNG image. When isolated=true, inactive children may briefly fire OnEnable — see the body for side-effect notes. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Screenshot / Isolated GameObject + +Renders a screenshot of a target GameObject with configurable isolation, background, camera angle, and lighting. When isolated=true (default), only the target object is visible via layer-based culling and inactive children of the target are temporarily activated for the render (their OnEnable callbacks may fire — restored in finally, but side effects like audio/network/animation events are not undoable). When isolated=false, the existing scene state is rendered as-is without activating inactive objects. Supports custom multi-light setups via JSON. Returns a base64-encoded PNG. + +## Camera views + +`Front` (-Z), `Back` (+Z), `Left` (-X), `Right` (+X), `Top` (+Y), `Bottom` (-Y). `Composite` produces a single 2x2 image (Front, Right, Back, Top) where each sub-view uses the requested `resolution`, so the final image is `resolution*2 x resolution*2`. + +## Background modes + +- `SolidColor` — flat color from `backgroundColor` (hex string). +- `Skybox` — current scene skybox. +- `Transparent` — alpha-zero (ARGB32 PNG; useful for compositing). + +## Lights + +`lights` is an optional JSON array of `IsolatedLightConfig` objects (type, color, intensity, rotation, position, range, spotAngle, innerSpotAngle, shadows, shadowStrength, bounceIntensity, colorTemperature, cookieSize, cullingMask, renderMode). When `null`, a default 1.0-intensity white directional light at rotation `(50, -30, 0)` is used. Empty array `[]` explicitly disables extra lights. + +## Side-effect caveat + +Isolation temporarily activates inactive child GameObjects so their renderers participate in the cull. Activation state is restored in `finally`, but OnEnable-triggered side effects (audio, networking, animation events) are not rewindable. Set `isolated=false` if your scene contains scripts that must not fire OnEnable during the capture. + +## How to Call + +```bash +unity-mcp-cli run-tool screenshot-isolated --input '{ + "gameObjectRef": "string_value", + "includeChildren": "string_value", + "isolated": "string_value", + "backgroundMode": "string_value", + "backgroundColor": "string_value", + "cameraView": "string_value", + "fieldOfView": "string_value", + "nearClipPlane": "string_value", + "farClipPlane": "string_value", + "padding": "string_value", + "lights": "string_value", + "resolution": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool screenshot-isolated --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool screenshot-isolated --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the target GameObject (by instanceId, path, or name). | +| `includeChildren` | `any` | No | Include child GameObjects in the render. Default: true. | +| `isolated` | `any` | No | When true, renders only the target object using layer-based culling. When false, renders the full scene from the computed camera position. Default: true. | +| `backgroundMode` | `any` | No | Background mode. Default: SolidColor. | +| `backgroundColor` | `string` | No | Hex background color (e.g. '#404040'). Only used when backgroundMode is SolidColor. | +| `cameraView` | `any` | No | Camera angle relative to the target object's bounding box. Default: Front. | +| `fieldOfView` | `any` | No | Camera vertical field of view in degrees. Default: 60. | +| `nearClipPlane` | `any` | No | Camera near clip plane distance. Default: 0.01. | +| `farClipPlane` | `any` | No | Camera far clip plane distance. Default: 1000. | +| `padding` | `any` | No | Framing multiplier around the object. 1.0 = tight fit, 1.5 = 50% extra space. Default: 1.2. | +| `lights` | `string` | No | JSON array of light configurations. Each object defines type, color, intensity, rotation, position, range, spotAngle, shadows, etc. When null, a default white directional light at rotation (50,-30,0) is used. Example: [{"type":"Directional","color":"#FFF4E5","intensity":1.2,"rotation":[45,-45,0]}] | +| `resolution` | `any` | No | Output image resolution in pixels (width = height). Default: 512. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "includeChildren": { + "$ref": "#/$defs/System.Boolean" + }, + "isolated": { + "$ref": "#/$defs/System.Boolean" + }, + "backgroundMode": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode" + }, + "backgroundColor": { + "type": "string" + }, + "cameraView": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView" + }, + "fieldOfView": { + "$ref": "#/$defs/System.Single" + }, + "nearClipPlane": { + "$ref": "#/$defs/System.Single" + }, + "farClipPlane": { + "$ref": "#/$defs/System.Single" + }, + "padding": { + "$ref": "#/$defs/System.Single" + }, + "lights": { + "type": "string" + }, + "resolution": { + "$ref": "#/$defs/System.Int32" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Boolean": { + "type": "boolean" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode": { + "type": "string", + "enum": [ + "SolidColor", + "Skybox", + "Transparent" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView": { + "type": "string", + "enum": [ + "Front", + "Back", + "Left", + "Right", + "Top", + "Bottom", + "Composite" + ] + }, + "System.Single": { + "type": "number" + }, + "System.Int32": { + "type": "integer" + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/screenshot-scene-view/SKILL.md b/.agent/skills/screenshot-scene-view/SKILL.md new file mode 100644 index 0000000..9301982 --- /dev/null +++ b/.agent/skills/screenshot-scene-view/SKILL.md @@ -0,0 +1,73 @@ +--- +name: screenshot-scene-view +description: Capture a screenshot from the Unity Editor Scene View at the requested size. Renders via the Scene View's active camera onto a temporary `RenderTexture`. Requires an open Scene View. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Screenshot / Scene View + +Captures a screenshot from the Unity Editor Scene View and returns it as an image. Returns the image directly for visual inspection by the LLM. + +## Inputs + +- `width` (default 1920) / `height` (default 1080) — output pixels. Must be > 0 and ≤ `MaxDimension`. + +## Behavior + +Uses `SceneView.lastActiveSceneView` (falls back to the first window in `SceneView.sceneViews`). Allocates a temporary `RenderTexture`, swaps it onto the Scene View's camera, calls `Render`, reads back with `Texture2D.ReadPixels`, encodes PNG, and restores the camera's prior `targetTexture`. Throws/errors when no Scene View is open or the Scene View camera is null. + +## How to Call + +```bash +unity-mcp-cli run-tool screenshot-scene-view --input '{ + "width": 0, + "height": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool screenshot-scene-view --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool screenshot-scene-view --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `width` | `integer` | No | Width of the screenshot in pixels. | +| `height` | `integer` | No | Height of the screenshot in pixels. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/script-delete/SKILL.md b/.agent/skills/script-delete/SKILL.md new file mode 100644 index 0000000..f2de7bf --- /dev/null +++ b/.agent/skills/script-delete/SKILL.md @@ -0,0 +1,80 @@ +--- +name: script-delete +description: Delete one or more `.cs` script files from disk, refresh the AssetDatabase, and wait for Unity compilation to settle before delivering the final result via the request's `requestId`. Pair with 'script-read' to inspect files before deletion. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Script / Delete + +Delete the script file(s). Does AssetDatabase.Refresh() and waits for Unity compilation to complete before reporting results. Use 'script-read' tool to read existing script files first. + +## Inputs + +- `files` — non-empty array of `.cs` paths. Every entry must exist on disk. +- `requestId` — required for the processing/delivered-later contract. + +## Behavior + +Validates the array (non-empty, every entry ends with `.cs`, every entry exists). Deletes each file plus its sibling `.meta` (when present). Calls `AssetDatabase.Refresh` and schedules a post-compilation notification — the final response is delivered after Unity finishes the recompile triggered by the delete. + +## How to Call + +```bash +unity-mcp-cli run-tool script-delete --input '{ + "files": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool script-delete --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool script-delete --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `files` | `any` | Yes | File paths to the files. Sample: "Assets/Scripts/MyScript.cs". | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "files": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "files" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/script-execute/SKILL.md b/.agent/skills/script-execute/SKILL.md new file mode 100644 index 0000000..be01e2f --- /dev/null +++ b/.agent/skills/script-execute/SKILL.md @@ -0,0 +1,198 @@ +--- +name: script-execute +description: Compiles and executes C# code dynamically using Roslyn. Supports a full-code mode (default) and a body-only mode — see the skill body for the difference and for how to pass Unity object references as parameters. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Script / Execute + +## Modes + +- **Full code mode** (default, `isMethodBody=false`): the `csharpCode` argument must define a complete class with a static method (no top-level statements). +- **Body-only mode** (`isMethodBody=true`): provide only the method body statements. The tool auto-generates the usings, class, and method header. + +## Passing Unity objects as parameters + +Unity objects (`GameObject`, `Component`, etc.) can be passed as parameters using their `Ref` types (`GameObjectRef`, `ComponentRef`, etc.) or directly by type: + +- `UnityEngine.GameObject` — resolves an actual GameObject from value `{"instanceID": N}`, `{"name": "..."}`, or `{"path": "..."}`. +- `UnityEngine.Component` (or any component subtype) — resolves from `{"instanceID": N}`. +- `AIGD.GameObjectRef` — passes a `GameObjectRef` POCO directly; the method body calls `goRef.FindGameObject()` to resolve it. +- `AIGD.ComponentRef` — passes a `ComponentRef` POCO. +- `AIGD.ObjectRef` — passes a base `ObjectRef` POCO. + +## How to Call + +```bash +unity-mcp-cli run-tool script-execute --input '{ + "csharpCode": "string_value", + "className": "string_value", + "methodName": "string_value", + "parameters": "string_value", + "isMethodBody": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool script-execute --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool script-execute --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `csharpCode` | `string` | Yes | C# code to compile and execute. In full code mode (default, isMethodBody=false): must define a complete class with a static method. Example: 'using UnityEngine; public class Script { public static void Main() { Debug.Log("Hello"); } }'. Do NOT use top-level statements. In body-only mode (isMethodBody=true): provide only the method body statements. The tool auto-generates usings, class, and method header. Example body: 'go.SetActive(false);'. Custom helper classes can still be defined inline in the body-only string after the main logic, but for complex additional class definitions use full code mode instead. | +| `className` | `string` | No | The name of the class containing the method to execute. In body-only mode this becomes the generated class name. | +| `methodName` | `string` | No | The name of the method to execute. Must be a static method. In body-only mode this becomes the generated method name. | +| `parameters` | `any` | No | Serialized parameters to pass to the method. Each entry must specify 'name' and 'typeName'. Supported parameter types include primitives, strings, and Unity object references: - 'UnityEngine.GameObject': resolves an actual GameObject from value '{"instanceID": N}', '{"name": "..."}', or '{"path": "..."}'. - 'UnityEngine.Component' (or any component subtype): resolves from '{"instanceID": N}'. - 'AIGD.GameObjectRef': passes a GameObjectRef POCO directly; the method body calls goRef.FindGameObject() to resolve it. - 'AIGD.ComponentRef': passes a ComponentRef POCO. - 'AIGD.ObjectRef': passes a base ObjectRef POCO. If the method does not require parameters, leave this empty. | +| `isMethodBody` | `boolean` | No | When true, 'csharpCode' is treated as just the method body. The tool auto-generates standard using directives (System, UnityEngine, AIGD, com.IvanMurzak.Unity.MCP.Runtime.Extensions, UnityEditor), the class definition, and the method signature (void return type). Parameters from the 'parameters' list are automatically added to the method signature using their typeName and name. When false (default), 'csharpCode' must be a complete C# compilation unit with class and method definitions. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "csharpCode": { + "type": "string" + }, + "className": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "parameters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList" + }, + "isMethodBody": { + "type": "boolean" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "csharpCode" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/script-read/SKILL.md b/.agent/skills/script-read/SKILL.md new file mode 100644 index 0000000..a0cb0b8 --- /dev/null +++ b/.agent/skills/script-read/SKILL.md @@ -0,0 +1,97 @@ +--- +name: script-read +description: Read a `.cs` script file and return its content as a string. Supports a 1-based `lineFrom`/`lineTo` slice for partial reads. Pair with 'script-update-or-create' to write back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Script / Read + +Reads the content of a script file and returns it as a string. Use 'script-update-or-create' tool to update or create script files. + +## Inputs + +- `filePath` — required `.cs` path. Throws if missing on disk. +- `lineFrom` (default 1, 1-based) — start line; clamped into valid range. +- `lineTo` (default -1 = end-of-file, 1-based) — inclusive end line; clamped into valid range. + +## Behavior + +Reads the file with `File.ReadAllLines` and slices `[lineFrom..lineTo]` (inclusive). The slice indices are clamped — passing out-of-range `lineFrom`/`lineTo` is forgiving (read returns at-most the whole file). + +## How to Call + +```bash +unity-mcp-cli run-tool script-read --input '{ + "filePath": "string_value", + "lineFrom": 0, + "lineTo": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool script-read --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool script-read --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filePath` | `string` | Yes | The path to the file. Sample: "Assets/Scripts/MyScript.cs". | +| `lineFrom` | `integer` | No | The line number to start reading from (1-based). | +| `lineTo` | `integer` | No | The line number to stop reading at (1-based, -1 for all lines). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filePath": { + "type": "string" + }, + "lineFrom": { + "type": "integer" + }, + "lineTo": { + "type": "integer" + } + }, + "required": [ + "filePath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/script-update-or-create/SKILL.md b/.agent/skills/script-update-or-create/SKILL.md new file mode 100644 index 0000000..e06d7f2 --- /dev/null +++ b/.agent/skills/script-update-or-create/SKILL.md @@ -0,0 +1,79 @@ +--- +name: script-update-or-create +description: Write a `.cs` script file (create or overwrite) with the provided C# code. Validates syntax via Roslyn before write — invalid code is rejected with error details and the file is left untouched. Refreshes the AssetDatabase and delivers the final result via `requestId` after Unity finishes the triggered compilation. Use 'script-read' to inspect existing content first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Script / Update or Create + +Updates or creates script file with the provided C# code. Does AssetDatabase.Refresh() at the end. Provides compilation error details if the code has syntax errors. Use 'script-read' tool to read existing script files first. + +## Inputs + +- `filePath` — required `.cs` path. +- `content` — C# source. MUST pass `ScriptUtils.IsValidCSharpSyntax`. +- `requestId` — required for the processing/delivered-later contract. + +## Behavior + +Creates any missing parent directories, writes the file, then calls `AssetDatabase.Refresh` and schedules a post-compilation notification so the final response is delivered after Unity finishes the recompile. + +## How to Call + +```bash +unity-mcp-cli run-tool script-update-or-create --input '{ + "filePath": "string_value", + "content": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool script-update-or-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool script-update-or-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `filePath` | `string` | Yes | The path to the file. Sample: "Assets/Scripts/MyScript.cs". | +| `content` | `string` | Yes | C# code - content of the file. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "filePath": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "required": [ + "filePath", + "content" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/splines-add-knot/SKILL.md b/.agent/skills/splines-add-knot/SKILL.md new file mode 100644 index 0000000..099c056 --- /dev/null +++ b/.agent/skills/splines-add-knot/SKILL.md @@ -0,0 +1,336 @@ +--- +name: splines-add-knot +description: Append a knot to a spline in a `SplineContainer`. A knot is a `BezierKnot` with a local position plus in/out tangents and a rotation. Returns the index of the appended knot. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Add Knot + +Append a new knot to the end of a spline. Knots define the control points the spline curve passes through. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `position` — local-space `Vector3` position of the knot (default zero). +- `tangentIn` — optional in tangent relative to the position (default `(0,0,-1)`). +- `tangentOut` — optional out tangent relative to the position (default `(0,0,1)`). +- `rotation` — optional euler-degrees rotation of the knot (default zero). +- `splineIndex` — which spline in the container to append to (default 0). + +## Behavior + +Builds a `BezierKnot` from the inputs, appends it to the chosen spline, marks the scene dirty, repaints, and returns the appended knot index plus the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-add-knot --input '{ + "gameObjectRef": "string_value", + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-add-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-add-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `position` | `any` | No | Local-space position of the new knot. | +| `tangentIn` | `any` | No | In tangent relative to the knot position. | +| `tangentOut` | `any` | No | Out tangent relative to the knot position. | +| `rotation` | `any` | No | Knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container to append to (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-add-spline/SKILL.md b/.agent/skills/splines-add-spline/SKILL.md new file mode 100644 index 0000000..488ec5e --- /dev/null +++ b/.agent/skills/splines-add-spline/SKILL.md @@ -0,0 +1,232 @@ +--- +name: splines-add-spline +description: Add an additional empty `Spline` to an existing `SplineContainer`. A container can hold many splines; this appends one and returns its new index. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Add Spline + +Add a new empty `Spline` to a `SplineContainer`. Use this when you need more than one spline on the same GameObject (e.g. a multi-path container). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `closed` — optional; when true the new spline is a closed loop (default false). + +## Behavior + +Appends a new empty spline to the container, applies the `Closed` flag, marks the scene dirty, repaints, and returns the index of the new spline and the resulting spline count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-add-spline --input '{ + "gameObjectRef": "string_value", + "closed": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-add-spline --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-add-spline --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `closed` | `boolean` | No | If true, the new spline is a closed loop. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "closed": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-AddSplineResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-AddSplineResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the newly added spline." + }, + "splineCount": { + "type": "integer", + "description": "Resulting number of splines in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the new spline is a closed loop." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "splineCount", + "closed", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-container-create/SKILL.md b/.agent/skills/splines-container-create/SKILL.md new file mode 100644 index 0000000..cb8ff2f --- /dev/null +++ b/.agent/skills/splines-container-create/SKILL.md @@ -0,0 +1,220 @@ +--- +name: splines-container-create +description: Create a new GameObject with a `SplineContainer` (and one initial empty `Spline`) in the active scene. Optionally set name, position and rotation. Returns the new GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Create Container + +Create a new GameObject hosting a `SplineContainer` component in the active scene. The `SplineContainer` is the authoring component that holds one or more `Spline`s; this tool seeds it with a single empty spline ready for knots. + +## Inputs + +- `name` — optional GameObject name (default `Spline`). +- `position` — optional world `Vector3` position (default zero). +- `rotation` — optional euler-degrees `Vector3` rotation (default zero). +- `closed` — optional; when true the seeded spline is a closed loop (default false). + +## Behavior + +Creates the GameObject, adds a `SplineContainer` with one empty spline, applies transform and the `Closed` flag, marks the scene dirty, repaints the Editor, and returns the new GameObject reference and instanceId. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-container-create --input '{ + "name": "string_value", + "position": "string_value", + "rotation": "string_value", + "closed": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-container-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-container-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | Name of the new SplineContainer GameObject. | +| `position` | `any` | No | World-space position of the GameObject. | +| `rotation` | `any` | No | World-space rotation of the GameObject in euler angles (degrees). | +| `closed` | `boolean` | No | If true, the seeded spline is a closed loop. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "closed": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerCreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerCreateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created SplineContainer component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created GameObject." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the created GameObject." + }, + "splineCount": { + "type": "integer", + "description": "Number of splines in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the seeded spline is a closed loop." + } + }, + "required": [ + "instanceId", + "splineCount", + "closed" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-evaluate/SKILL.md b/.agent/skills/splines-evaluate/SKILL.md new file mode 100644 index 0000000..26c296a --- /dev/null +++ b/.agent/skills/splines-evaluate/SKILL.md @@ -0,0 +1,268 @@ +--- +name: splines-evaluate +description: Evaluate a spline at normalized parameter `t` in [0,1], returning the local-space and world-space position, the tangent (direction of travel), and the up vector. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Evaluate + +Sample a spline at a point along its length. `t` is normalized: 0 is the first knot, 1 is the last knot (or the loop point for a closed spline). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `t` — normalized parameter in [0,1] (default 0.5). Values outside are clamped. +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Evaluates local position / tangent / up via `Spline.Evaluate`, transforms the position into world space using the container's transform, and returns all of them. The spline must have at least 2 knots. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-evaluate --input '{ + "gameObjectRef": "string_value", + "t": 0, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-evaluate --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-evaluate --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `t` | `number` | No | Normalized parameter along the spline in [0,1] (clamped). Default 0.5. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "t": { + "type": "number" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-EvaluateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-EvaluateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the evaluated spline in the container." + }, + "t": { + "type": "number", + "description": "Normalized parameter actually evaluated (after clamping)." + }, + "localPosition": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position at t." + }, + "worldPosition": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "World-space position at t." + }, + "tangent": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Tangent (direction of travel) at t." + }, + "up": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Up vector at t." + } + }, + "required": [ + "splineIndex", + "t", + "localPosition", + "worldPosition", + "tangent", + "up" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-get-knots/SKILL.md b/.agent/skills/splines-get-knots/SKILL.md new file mode 100644 index 0000000..ebd0253 --- /dev/null +++ b/.agent/skills/splines-get-knots/SKILL.md @@ -0,0 +1,293 @@ +--- +name: splines-get-knots +description: "Read all knots of a spline in a `SplineContainer`: per-knot position, in/out tangents, rotation, and tangent mode, plus the closed flag. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Get Knots + +Inspect the knots of a specific spline. Useful before editing to know the indices, positions, and tangent modes. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Enumerates every knot of the chosen spline and returns a per-knot summary plus the spline's `Closed` flag. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-get-knots --input '{ + "gameObjectRef": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-get-knots --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-get-knots --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-GetKnotsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-GetKnotsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the spline in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the spline is a closed loop." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "knots": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo-1", + "description": "Per-knot summaries." + } + }, + "required": [ + "splineIndex", + "closed", + "knotCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-get/SKILL.md b/.agent/skills/splines-get/SKILL.md new file mode 100644 index 0000000..21c3264 --- /dev/null +++ b/.agent/skills/splines-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: splines-get +description: "Generic read: serialize any Splines `Component` (a type in the `UnityEngine.Splines` namespace, e.g. `SplineContainer`, `SplineInstantiate`, `SplineAnimate`) on a GameObject via ReflectorNet. Pair with 'splines-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Get Component + +Serialize any Splines component on a GameObject using ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Splines component; otherwise the first component whose type lives in the `UnityEngine.Splines` namespace is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target Splines component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Splines component. | +| `componentRef` | `any` | No | Optional reference to a specific Splines component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-insert-knot/SKILL.md b/.agent/skills/splines-insert-knot/SKILL.md new file mode 100644 index 0000000..d99842d --- /dev/null +++ b/.agent/skills/splines-insert-knot/SKILL.md @@ -0,0 +1,342 @@ +--- +name: splines-insert-knot +description: Insert a knot at a specific index in a spline, shifting later knots forward. Use this to add a control point in the middle of an existing path. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Insert Knot + +Insert a new knot at a given index in a spline. Knots at and after the index shift forward by one. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index to insert at (0..knotCount; required). +- `position` — local-space `Vector3` position of the knot (default zero). +- `tangentIn` / `tangentOut` — optional tangents (defaults `(0,0,-1)` / `(0,0,1)`). +- `rotation` — optional euler-degrees rotation (default zero). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Validates the index range (0..count inclusive), builds a `BezierKnot`, inserts it, marks dirty, repaints, and returns the inserted knot index and the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-insert-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-insert-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-insert-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index at which to insert the knot (0..knotCount). | +| `position` | `any` | No | Local-space position of the new knot. | +| `tangentIn` | `any` | No | In tangent relative to the knot position. | +| `tangentOut` | `any` | No | Out tangent relative to the knot position. | +| `rotation` | `any` | No | Knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-list/SKILL.md b/.agent/skills/splines-list/SKILL.md new file mode 100644 index 0000000..cb7b19e --- /dev/null +++ b/.agent/skills/splines-list/SKILL.md @@ -0,0 +1,224 @@ +--- +name: splines-list +description: List every `SplineContainer` in the active scene with its name, spline count, and the knot count of each spline. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / List Containers + +Enumerate the `SplineContainer`s in the active scene. For each, returns a reference, the name, the number of splines, and per-spline knot counts and closed flags. + +## Inputs + +- `includeInactive` (bool, default true) — include containers on inactive/disabled GameObjects. + +## Behavior + +Finds all `SplineContainer` instances and summarizes them. Read-only. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include containers on inactive/disabled GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "name": { + "type": "string", + "description": "Name of the container GameObject." + }, + "splineCount": { + "type": "integer", + "description": "Number of splines in the container." + }, + "splines": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary-1", + "description": "Per-spline summaries." + } + }, + "required": [ + "splineCount" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary": { + "type": "object", + "properties": { + "splineIndex": { + "type": "integer", + "description": "Index of the spline in the container." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "closed": { + "type": "boolean", + "description": "Whether the spline is a closed loop." + } + }, + "required": [ + "splineIndex", + "knotCount", + "closed" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of SplineContainers found." + }, + "containers": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem-1", + "description": "The SplineContainers in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-modify/SKILL.md b/.agent/skills/splines-modify/SKILL.md new file mode 100644 index 0000000..aede7db --- /dev/null +++ b/.agent/skills/splines-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: splines-modify +description: "Generic write: apply a `SerializedMember` diff to any Splines `Component` on a GameObject via ReflectorNet `TryModify`. Use 'splines-get' first to inspect the structure so the diff is targeted. Fields go through the `fields` channel, properties through `props` (no cross-fallback)." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Modify Component + +Modify any Splines component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Public fields MUST be supplied through the `fields` channel and properties through `props`; ReflectorNet does not cross-fall-back. +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Splines component; otherwise the first component in the `UnityEngine.Splines` namespace is used. + +## Behavior + +Finds the target Splines component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Splines component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific Splines component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-remove-knot/SKILL.md b/.agent/skills/splines-remove-knot/SKILL.md new file mode 100644 index 0000000..f187c96 --- /dev/null +++ b/.agent/skills/splines-remove-knot/SKILL.md @@ -0,0 +1,299 @@ +--- +name: splines-remove-knot +description: "Remove the knot at a given index from a spline, shifting later knots back. Destructive: the removed control point is gone." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Remove Knot + +Remove a knot at a specific index from a spline. Knots after the index shift back by one. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot to remove (0..knotCount-1; required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Validates the index range, removes the knot via `Spline.RemoveAt`, marks the scene dirty, repaints, and returns the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-remove-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-remove-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-remove-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to remove (0..knotCount-1). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-set-closed/SKILL.md b/.agent/skills/splines-set-closed/SKILL.md new file mode 100644 index 0000000..fdba0ec --- /dev/null +++ b/.agent/skills/splines-set-closed/SKILL.md @@ -0,0 +1,238 @@ +--- +name: splines-set-closed +description: Toggle whether a spline is a closed loop. A closed spline connects its last knot back to its first, forming a continuous loop. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Closed + +Set the `Closed` flag of a spline. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `closed` — true to close the loop, false to open it (default true). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Assigns `Spline.Closed`, marks the scene dirty, repaints, and returns the resulting state. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-closed --input '{ + "gameObjectRef": "string_value", + "closed": false, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-closed --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-closed --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `closed` | `boolean` | No | True to close the loop, false to open it. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "closed": { + "type": "boolean" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SetClosedResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SetClosedResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "closed": { + "type": "boolean", + "description": "Resulting closed-loop state." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "closed", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-set-knot/SKILL.md b/.agent/skills/splines-set-knot/SKILL.md new file mode 100644 index 0000000..19e91ce --- /dev/null +++ b/.agent/skills/splines-set-knot/SKILL.md @@ -0,0 +1,342 @@ +--- +name: splines-set-knot +description: Set position, in/out tangents, and/or rotation of an existing knot in a spline. Only the fields you pass are changed; the rest are preserved. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Knot + +Edit an existing knot in place. `BezierKnot` is a value type, so this reads the current knot, applies only the provided fields, and writes it back through the spline indexer (which rebuilds the cached curve). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot to edit (required). +- `position` — optional new local-space position. +- `tangentIn` / `tangentOut` — optional new tangents. +- `rotation` — optional new euler-degrees rotation. +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Reads the knot, overrides only the supplied fields, writes it back, marks the scene dirty, repaints, and returns the resulting knot summary. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to edit (0..knotCount-1). | +| `position` | `any` | No | New local-space position of the knot. | +| `tangentIn` | `any` | No | New in tangent relative to the knot position. | +| `tangentOut` | `any` | No | New out tangent relative to the knot position. | +| `rotation` | `any` | No | New knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/splines-set-tangent-mode/SKILL.md b/.agent/skills/splines-set-tangent-mode/SKILL.md new file mode 100644 index 0000000..fc4c86f --- /dev/null +++ b/.agent/skills/splines-set-tangent-mode/SKILL.md @@ -0,0 +1,306 @@ +--- +name: splines-set-tangent-mode +description: "Set the `TangentMode` of a knot in a spline. Valid modes: Linear, Continuous, Broken, AutoSmooth, Mirrored. The mode controls how the knot's in/out tangents are computed." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Tangent Mode + +Change how a knot's tangents behave by setting its `TangentMode`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot (required). +- `tangentMode` — one of `Linear`, `Continuous`, `Broken`, `AutoSmooth`, `Mirrored` (case-insensitive, required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Parses the mode, applies it via `Spline.SetTangentMode(index, mode)`, marks the scene dirty, repaints, and returns the resulting knot summary. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-tangent-mode --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "tangentMode": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-tangent-mode --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-tangent-mode --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to edit (0..knotCount-1). | +| `tangentMode` | `string` | Yes | Tangent mode: Linear, Continuous, Broken, AutoSmooth, or Mirrored (case-insensitive). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "tangentMode": { + "type": "string" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "knotIndex", + "tangentMode" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-add-layer/SKILL.md b/.agent/skills/terrain-add-layer/SKILL.md new file mode 100644 index 0000000..c2bbb0c --- /dev/null +++ b/.agent/skills/terrain-add-layer/SKILL.md @@ -0,0 +1,244 @@ +--- +name: terrain-add-layer +description: Add a `TerrainLayer` to a `Terrain`. Provide either the asset path of an existing `.terrainlayer` asset, or a texture asset path to build a new TerrainLayer from. Returns the index of the added layer. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Add Layer + +Append a `TerrainLayer` to a `Terrain`'s `TerrainData.terrainLayers`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `terrainLayerAssetPath` — optional project path to an existing `.terrainlayer` asset to add. +- `diffuseTextureAssetPath` — optional project path to a `Texture2D`. When `terrainLayerAssetPath` is omitted, a new `TerrainLayer` is created in-memory with this diffuse texture and added. +- `tileSizeX` / `tileSizeY` — tile size (world units) for a newly-created layer (default 15,15). + +## Behavior + +Loads or creates the `TerrainLayer`, appends it to `TerrainData.terrainLayers`, marks the asset + scene dirty, repaints, and returns the new layer index. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-add-layer --input '{ + "gameObjectRef": "string_value", + "terrainLayerAssetPath": "string_value", + "diffuseTextureAssetPath": "string_value", + "tileSizeX": 0, + "tileSizeY": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-add-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-add-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `terrainLayerAssetPath` | `string` | No | Optional project path to an existing .terrainlayer asset to add. | +| `diffuseTextureAssetPath` | `string` | No | Optional project path to a Texture2D used to build a new TerrainLayer (when no asset path is given). | +| `tileSizeX` | `number` | No | Tile size X (world units) for a newly-created layer. | +| `tileSizeY` | `number` | No | Tile size Y (world units) for a newly-created layer. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "terrainLayerAssetPath": { + "type": "string" + }, + "diffuseTextureAssetPath": { + "type": "string" + }, + "tileSizeX": { + "type": "number" + }, + "tileSizeY": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainAddLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainAddLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerIndex": { + "type": "integer", + "description": "Index of the added TerrainLayer." + }, + "layerCount": { + "type": "integer", + "description": "Total number of TerrainLayers after the add." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerIndex", + "layerCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-create/SKILL.md b/.agent/skills/terrain-create/SKILL.md new file mode 100644 index 0000000..ce483b6 --- /dev/null +++ b/.agent/skills/terrain-create/SKILL.md @@ -0,0 +1,261 @@ +--- +name: terrain-create +description: Create a new GameObject with a `Terrain` + `TerrainCollider` backed by a freshly created `TerrainData` asset. Set heightmap resolution and the terrain world size (width/height/length). Returns the new GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Create Terrain + +Create a new GameObject hosting a `Terrain` and a `TerrainCollider` in the active scene, backed by a new `TerrainData` asset saved to the project. + +## Inputs + +- `name` — optional GameObject name (default `Terrain`). +- `terrainDataAssetPath` — project path for the new `TerrainData` asset (default `Assets/TerrainData_.asset`). Must start with `Assets/` and end with `.asset`. +- `heightmapResolution` — heightmap resolution; rounded to a valid `2^n + 1` value (default 513). +- `width` / `length` — horizontal terrain size in world units (X / Z, default 1000 each). +- `height` — vertical terrain size in world units (Y, default 600). +- `position` — optional world position of the terrain GameObject (default zero). + +## Behavior + +Creates the `TerrainData`, sets its `heightmapResolution` and `size`, writes it as an asset, then creates the GameObject via `Terrain.CreateTerrainGameObject`, positions it, marks the scene dirty, repaints, and returns the new GameObject reference and instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-create --input '{ + "name": "string_value", + "terrainDataAssetPath": "string_value", + "heightmapResolution": 0, + "width": 0, + "length": 0, + "height": 0, + "position": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | Name of the new Terrain GameObject. | +| `terrainDataAssetPath` | `string` | No | Project path for the new TerrainData asset (Assets/...asset). Defaults to Assets/TerrainData_.asset. | +| `heightmapResolution` | `integer` | No | Heightmap resolution. Rounded up to a valid (2^n + 1) value. | +| `width` | `number` | No | Terrain width in world units (X axis). | +| `length` | `number` | No | Terrain length in world units (Z axis). | +| `height` | `number` | No | Terrain height in world units (Y axis). | +| `position` | `any` | No | World-space position of the terrain GameObject. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "terrainDataAssetPath": { + "type": "string" + }, + "heightmapResolution": { + "type": "integer" + }, + "width": { + "type": "number" + }, + "length": { + "type": "number" + }, + "height": { + "type": "number" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainCreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainCreateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created Terrain component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created GameObject." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the created GameObject." + }, + "terrainDataAssetPath": { + "type": "string", + "description": "Project path of the created TerrainData asset." + }, + "heightmapResolution": { + "type": "integer", + "description": "Resolved heightmap resolution." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved terrain size (X=width, Y=height, Z=length)." + } + }, + "required": [ + "instanceId", + "heightmapResolution", + "size" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-get-component/SKILL.md b/.agent/skills/terrain-get-component/SKILL.md new file mode 100644 index 0000000..2b969b0 --- /dev/null +++ b/.agent/skills/terrain-get-component/SKILL.md @@ -0,0 +1,295 @@ +--- +name: terrain-get-component +description: "Generic read: serialize a terrain-related `Component` (`Terrain` or `TerrainCollider`) on a GameObject via ReflectorNet. The escape hatch for fields not covered by the dedicated tools. Pair with 'terrain-modify-component'. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Get Component (generic) + +Serialize a terrain component on a GameObject using ReflectorNet. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one; otherwise the first `Terrain` (or, failing that, the first `TerrainCollider`) is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target terrain component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-get-component --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-get-component --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-get-component --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the terrain component. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetComponentResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetComponentResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-get/SKILL.md b/.agent/skills/terrain-get/SKILL.md new file mode 100644 index 0000000..26c8a4c --- /dev/null +++ b/.agent/skills/terrain-get/SKILL.md @@ -0,0 +1,311 @@ +--- +name: terrain-get +description: Inspect a `Terrain` — its `TerrainData` size, heightmap / alphamap / detail resolutions, the list of TerrainLayers, tree/detail prototype counts, tree-instance count, and neighbor terrains. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Get Terrain + +Inspect a `Terrain` component in the active scene and report its `TerrainData` configuration. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). + +## Behavior + +Reads `TerrainData.size`, `heightmapResolution`, `alphamapResolution`, `detailResolution`, the `terrainLayers` (with their diffuse-texture names), the tree- and detail-prototype counts, the number of placed tree instances, and the left/top/right/bottom neighbor terrains. Read-only — nothing is mutated. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-get --input '{ + "gameObjectRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the layer in the terrain's layer list." + }, + "name": { + "type": "string", + "description": "Name of the TerrainLayer asset." + }, + "assetPath": { + "type": "string", + "description": "Project asset path of the TerrainLayer, or null." + }, + "diffuseTexture": { + "type": "string", + "description": "Name of the layer's diffuse texture, or null." + } + }, + "required": [ + "index" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Terrain size (X=width, Y=height, Z=length) in world units." + }, + "heightmapResolution": { + "type": "integer", + "description": "Heightmap resolution." + }, + "alphamapResolution": { + "type": "integer", + "description": "Alphamap (splatmap) resolution." + }, + "detailResolution": { + "type": "integer", + "description": "Detail resolution." + }, + "layers": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo-1", + "description": "The TerrainLayers assigned to the terrain." + }, + "treePrototypeCount": { + "type": "integer", + "description": "Number of tree prototypes." + }, + "detailPrototypeCount": { + "type": "integer", + "description": "Number of detail prototypes." + }, + "treeInstanceCount": { + "type": "integer", + "description": "Number of placed tree instances." + }, + "leftNeighbor": { + "type": "string", + "description": "Name of the left neighbor terrain, or null." + }, + "topNeighbor": { + "type": "string", + "description": "Name of the top neighbor terrain, or null." + }, + "rightNeighbor": { + "type": "string", + "description": "Name of the right neighbor terrain, or null." + }, + "bottomNeighbor": { + "type": "string", + "description": "Name of the bottom neighbor terrain, or null." + } + }, + "required": [ + "size", + "heightmapResolution", + "alphamapResolution", + "detailResolution", + "treePrototypeCount", + "detailPrototypeCount", + "treeInstanceCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-list/SKILL.md b/.agent/skills/terrain-list/SKILL.md new file mode 100644 index 0000000..19809ae --- /dev/null +++ b/.agent/skills/terrain-list/SKILL.md @@ -0,0 +1,222 @@ +--- +name: terrain-list +description: List every `Terrain` in the active scene with its name, world size, heightmap resolution, and TerrainLayer count. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / List Terrains + +List every `Terrain` in the active scene. + +## Inputs + +- `includeInactive` (bool, default true) — include Terrains on inactive/disabled GameObjects. + +## Behavior + +Finds all `Terrain` instances, and for each returns the GameObject reference, the name, the `TerrainData.size`, the heightmap resolution, and the number of TerrainLayers. Read-only. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include Terrains on inactive/disabled GameObjects; if false, only active ones. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "name": { + "type": "string", + "description": "Name of the terrain GameObject." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Terrain size (X=width, Y=height, Z=length)." + }, + "heightmapResolution": { + "type": "integer", + "description": "Heightmap resolution." + }, + "layerCount": { + "type": "integer", + "description": "Number of TerrainLayers assigned." + } + }, + "required": [ + "size", + "heightmapResolution", + "layerCount" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of Terrains found." + }, + "terrains": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem-1", + "description": "The Terrains in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-modify-component/SKILL.md b/.agent/skills/terrain-modify-component/SKILL.md new file mode 100644 index 0000000..95d421c --- /dev/null +++ b/.agent/skills/terrain-modify-component/SKILL.md @@ -0,0 +1,307 @@ +--- +name: terrain-modify-component +description: "Generic write: apply a `SerializedMember` diff to a terrain-related `Component` (`Terrain` or `TerrainCollider`) via ReflectorNet `TryModify`. Use 'terrain-get-component' first to inspect the structure. Route fields through the `fields` channel and properties through `props`." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Modify Component (generic) + +Modify a terrain component by applying a `SerializedMember` diff via ReflectorNet. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Put C# *fields* in the `fields` channel and *properties* in the `props` channel (ReflectorNet resolves them separately — no cross-fallback). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one; otherwise the first `Terrain` (or `TerrainCollider`) is used. + +## Behavior + +Finds the target terrain component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-modify-component --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-modify-component --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-modify-component --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the terrain component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Fields via the 'fields' channel, properties via 'props'. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainModifyComponentResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainModifyComponentResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-paint-layer/SKILL.md b/.agent/skills/terrain-paint-layer/SKILL.md new file mode 100644 index 0000000..d02a747 --- /dev/null +++ b/.agent/skills/terrain-paint-layer/SKILL.md @@ -0,0 +1,271 @@ +--- +name: terrain-paint-layer +description: Paint a `TerrainLayer` over a rectangular region (or the whole terrain) by writing the alphamap (splatmap) so the chosen layer has the given weight there and the other layers are reduced proportionally. Alphamap weights are normalized [0,1]. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Paint Layer + +Write the alphamap (splatmap) of a `Terrain` so one `TerrainLayer` dominates a region. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `layerIndex` — index of the `TerrainLayer` to paint (required; must already be on the terrain). +- `xBase` / `yBase` — top-left alphamap cell of the region (default 0,0). +- `width` / `height` — region size in alphamap cells. When <= 0, spans to the alphamap edge. +- `strength` — target normalized [0,1] weight for the chosen layer (default 1 = fully painted). + +## Behavior + +Reads the region alphamaps via `GetAlphamaps`, sets the chosen layer's weight to `strength` and scales the remaining layers so each cell's weights sum to 1, then writes back with `SetAlphamaps`. Destructive. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-paint-layer --input '{ + "gameObjectRef": "string_value", + "layerIndex": 0, + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "strength": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-paint-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-paint-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `layerIndex` | `integer` | Yes | Index of the TerrainLayer to paint (must already be on the terrain). | +| `xBase` | `integer` | No | Top-left alphamap X cell of the region. | +| `yBase` | `integer` | No | Top-left alphamap Y cell of the region. | +| `width` | `integer` | No | Region width in alphamap cells. <= 0 spans to the alphamap edge. | +| `height` | `integer` | No | Region height in alphamap cells. <= 0 spans to the alphamap edge. | +| `strength` | `number` | No | Target normalized [0,1] weight for the chosen layer (1 = fully painted). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "layerIndex": { + "type": "integer" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "strength": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "layerIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPaintLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPaintLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerIndex": { + "type": "integer", + "description": "Index of the painted TerrainLayer." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerIndex", + "xBase", + "yBase", + "width", + "height", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-place-trees/SKILL.md b/.agent/skills/terrain-place-trees/SKILL.md new file mode 100644 index 0000000..f004db1 --- /dev/null +++ b/.agent/skills/terrain-place-trees/SKILL.md @@ -0,0 +1,304 @@ +--- +name: terrain-place-trees +description: Place trees on a `Terrain` using an existing tree prototype. Either scatter `count` trees randomly across a normalized [0,1] sub-rectangle, or place trees at explicit normalized positions. Optionally clear existing trees first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Place Trees + +Add `TreeInstance`s to a `Terrain`. Tree positions are normalized [0,1] across the terrain. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `prototypeIndex` — index of the tree prototype to place (must already be on the terrain, default 0). +- `count` — number of trees to scatter randomly (used when `positions` is omitted; default 100). +- `minX` / `minZ` / `maxX` / `maxZ` — normalized [0,1] sub-rectangle to scatter within (default 0..1 on both axes). +- `positions` — optional explicit normalized [0,1] XZ positions (each a `Vector2`, x→X, y→Z). When provided, overrides random scatter. +- `heightScale` / `widthScale` — per-instance scale (default 1). +- `clearExisting` — when `true`, removes existing trees before placing (default false). + +## Behavior + +Validates the prototype index, builds `TreeInstance`s (sampling the terrain height at each normalized position), and assigns them via `TerrainData.SetTreeInstances(..., snapToHeightmap:true)`. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-place-trees --input '{ + "gameObjectRef": "string_value", + "prototypeIndex": 0, + "count": 0, + "minX": 0, + "minZ": 0, + "maxX": 0, + "maxZ": 0, + "positions": "string_value", + "heightScale": 0, + "widthScale": 0, + "clearExisting": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-place-trees --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-place-trees --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `prototypeIndex` | `integer` | No | Index of the tree prototype to place (must already be on the terrain). | +| `count` | `integer` | No | Number of trees to scatter randomly when 'positions' is omitted. | +| `minX` | `number` | No | Normalized [0,1] minimum X of the scatter sub-rectangle. | +| `minZ` | `number` | No | Normalized [0,1] minimum Z of the scatter sub-rectangle. | +| `maxX` | `number` | No | Normalized [0,1] maximum X of the scatter sub-rectangle. | +| `maxZ` | `number` | No | Normalized [0,1] maximum Z of the scatter sub-rectangle. | +| `positions` | `any` | No | Optional explicit normalized [0,1] XZ positions (Vector2: x->X, y->Z). | +| `heightScale` | `number` | No | Per-instance height scale. | +| `widthScale` | `number` | No | Per-instance width scale. | +| `clearExisting` | `boolean` | No | If true, removes existing trees before placing. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "prototypeIndex": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "minX": { + "type": "number" + }, + "minZ": { + "type": "number" + }, + "maxX": { + "type": "number" + }, + "maxZ": { + "type": "number" + }, + "positions": { + "$ref": "#/$defs/UnityEngine.Vector2-1" + }, + "heightScale": { + "type": "number" + }, + "widthScale": { + "type": "number" + }, + "clearExisting": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "required": [ + "x", + "y" + ], + "additionalProperties": false + }, + "UnityEngine.Vector2-1": { + "type": "array", + "items": { + "$ref": "#/$defs/UnityEngine.Vector2" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPlaceTreesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPlaceTreesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "prototypeIndex": { + "type": "integer", + "description": "Index of the placed tree prototype." + }, + "treesAdded": { + "type": "integer", + "description": "Number of trees added by this call." + }, + "treeInstanceCount": { + "type": "integer", + "description": "Total tree instance count after the call." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "prototypeIndex", + "treesAdded", + "treeInstanceCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-remove-layer/SKILL.md b/.agent/skills/terrain-remove-layer/SKILL.md new file mode 100644 index 0000000..7905b18 --- /dev/null +++ b/.agent/skills/terrain-remove-layer/SKILL.md @@ -0,0 +1,223 @@ +--- +name: terrain-remove-layer +description: Remove a `TerrainLayer` from a `Terrain` by its index. Returns the remaining layer count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Remove Layer + +Remove a `TerrainLayer` from a `Terrain`'s `TerrainData.terrainLayers` by index. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `layerIndex` — index of the layer to remove (required). + +## Behavior + +Validates the index against the current layer count, removes the layer, reassigns `TerrainData.terrainLayers`, marks the asset + scene dirty, repaints, and returns the remaining layer count. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-remove-layer --input '{ + "gameObjectRef": "string_value", + "layerIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-remove-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-remove-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `layerIndex` | `integer` | Yes | Index of the TerrainLayer to remove. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "layerIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "layerIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainRemoveLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainRemoveLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerCount": { + "type": "integer", + "description": "Total number of TerrainLayers after the removal." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-sample-heights/SKILL.md b/.agent/skills/terrain-sample-heights/SKILL.md new file mode 100644 index 0000000..515044d --- /dev/null +++ b/.agent/skills/terrain-sample-heights/SKILL.md @@ -0,0 +1,285 @@ +--- +name: terrain-sample-heights +description: Read heightmap values over a rectangular region (or the whole terrain) of a `Terrain`. Returns the normalized [0,1] heights plus min/max/average statistics. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Sample Heights + +Sample heightmap values from a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `xBase` / `yBase` — top-left heightmap cell of the region (default 0,0). +- `width` / `height` — region size in heightmap cells. When <= 0, the region spans to the edge of the heightmap from the base. +- `includeArray` — when `true`, include the full row-major `[height][width]` heights array in the response (can be large); otherwise only statistics are returned (default false). + +## Behavior + +Resolves and clamps the region against `heightmapResolution`, calls `TerrainData.GetHeights`, computes min/max/average over the sampled cells, and optionally returns the full array. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-sample-heights --input '{ + "gameObjectRef": "string_value", + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "includeArray": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-sample-heights --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-sample-heights --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `xBase` | `integer` | No | Top-left heightmap X cell of the region. | +| `yBase` | `integer` | No | Top-left heightmap Y cell of the region. | +| `width` | `integer` | No | Region width in heightmap cells. <= 0 spans to the heightmap edge. | +| `height` | `integer` | No | Region height in heightmap cells. <= 0 spans to the heightmap edge. | +| `includeArray` | `boolean` | No | If true, include the full row-major [height][width] heights array in the response. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "includeArray": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSampleHeightsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + }, + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSampleHeightsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "min": { + "type": "number", + "description": "Minimum normalized [0,1] height in the region." + }, + "max": { + "type": "number", + "description": "Maximum normalized [0,1] height in the region." + }, + "average": { + "type": "number", + "description": "Average normalized [0,1] height in the region." + }, + "heights": { + "$ref": "#/$defs/System.Single-1-1", + "description": "Row-major [height][width] heights array, or null when includeArray is false." + } + }, + "required": [ + "xBase", + "yBase", + "width", + "height", + "min", + "max", + "average" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-detail-prototypes/SKILL.md b/.agent/skills/terrain-set-detail-prototypes/SKILL.md new file mode 100644 index 0000000..ee29b32 --- /dev/null +++ b/.agent/skills/terrain-set-detail-prototypes/SKILL.md @@ -0,0 +1,236 @@ +--- +name: terrain-set-detail-prototypes +description: Replace the detail prototypes (grass / detail meshes) of a `Terrain` with a new set built from texture or prefab asset paths. Returns the resulting prototype count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Detail Prototypes + +Replace `TerrainData.detailPrototypes` with a new set. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `textureAssetPaths` — optional list of `Texture2D` asset paths; each becomes a Grass-billboard detail prototype. +- `prefabAssetPaths` — optional list of prefab/GameObject asset paths; each becomes a VertexLit detail-mesh prototype. + +At least one of the two lists must be non-empty. + +## Behavior + +Loads each asset, builds a `DetailPrototype` (texture → `usePrototypeMesh=false`+`prototypeTexture`, prefab → `usePrototypeMesh=true`+`prototype`), assigns the array to `TerrainData.detailPrototypes`, marks dirty + repaints, and returns the count. Destructive (replaces existing prototypes). Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-detail-prototypes --input '{ + "gameObjectRef": "string_value", + "textureAssetPaths": "string_value", + "prefabAssetPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-detail-prototypes --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-detail-prototypes --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `textureAssetPaths` | `any` | No | Optional Texture2D asset paths; each becomes a grass-billboard detail prototype. | +| `prefabAssetPaths` | `any` | No | Optional prefab/GameObject asset paths; each becomes a detail-mesh prototype. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "textureAssetPaths": { + "$ref": "#/$defs/System.String-1" + }, + "prefabAssetPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetDetailPrototypesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetDetailPrototypesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "detailPrototypeCount": { + "type": "integer", + "description": "Number of detail prototypes after the set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "detailPrototypeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-heightmap-resolution/SKILL.md b/.agent/skills/terrain-set-heightmap-resolution/SKILL.md new file mode 100644 index 0000000..a5e7223 --- /dev/null +++ b/.agent/skills/terrain-set-heightmap-resolution/SKILL.md @@ -0,0 +1,223 @@ +--- +name: terrain-set-heightmap-resolution +description: Set the heightmap resolution of a `Terrain`'s `TerrainData`. The value is rounded up to a valid `2^n + 1`. Changing resolution resamples the existing heightmap. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Heightmap Resolution + +Set the heightmap resolution of a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `heightmapResolution` — requested resolution; rounded up to a valid `2^n + 1` value (clamped to Unity's [33, 4097] range). + +## Behavior + +Assigns `TerrainData.heightmapResolution`. This is destructive: Unity resamples the existing heightmap to the new resolution. Marks the asset + scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-heightmap-resolution --input '{ + "gameObjectRef": "string_value", + "heightmapResolution": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-heightmap-resolution --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-heightmap-resolution --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `heightmapResolution` | `integer` | Yes | Requested heightmap resolution. Rounded up to a valid (2^n + 1) value. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "heightmapResolution": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "heightmapResolution" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightmapResolutionResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightmapResolutionResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "heightmapResolution": { + "type": "integer", + "description": "Resolved heightmap resolution." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "heightmapResolution", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-heights/SKILL.md b/.agent/skills/terrain-set-heights/SKILL.md new file mode 100644 index 0000000..d9c7cd6 --- /dev/null +++ b/.agent/skills/terrain-set-heights/SKILL.md @@ -0,0 +1,277 @@ +--- +name: terrain-set-heights +description: Set heightmap values over a rectangular region (or the whole terrain) of a `Terrain`. Either fill the region with a uniform normalized height, or supply an explicit row-major 2D heights array. Heights are normalized [0,1] of the terrain's Y size. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Heights + +Write heightmap values into a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `xBase` / `yBase` — top-left heightmap cell of the region (default 0,0). +- `width` / `height` — region size in heightmap cells. When <= 0, the region spans to the edge of the heightmap from the base. +- `uniformHeight` — when `heights` is omitted, fill the whole region with this normalized [0,1] value (default 0). +- `heights` — optional explicit row-major `[height][width]` array of normalized [0,1] values. When provided, its dimensions define the region size (overriding width/height). + +## Behavior + +Resolves and clamps the region against `heightmapResolution`, builds a `[h,w]` height array (uniform fill or from `heights`), and calls `TerrainData.SetHeights(xBase, yBase, array)`. Destructive: overwrites existing heights in the region. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-heights --input '{ + "gameObjectRef": "string_value", + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "uniformHeight": 0, + "heights": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-heights --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-heights --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `xBase` | `integer` | No | Top-left heightmap X cell of the region. | +| `yBase` | `integer` | No | Top-left heightmap Y cell of the region. | +| `width` | `integer` | No | Region width in heightmap cells. <= 0 spans to the heightmap edge. | +| `height` | `integer` | No | Region height in heightmap cells. <= 0 spans to the heightmap edge. | +| `uniformHeight` | `number` | No | Uniform normalized [0,1] height used to fill the region when 'heights' is omitted. | +| `heights` | `any` | No | Optional explicit row-major [height][width] array of normalized [0,1] heights. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "uniformHeight": { + "type": "number" + }, + "heights": { + "$ref": "#/$defs/System.Single-1-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "xBase", + "yBase", + "width", + "height", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-neighbors/SKILL.md b/.agent/skills/terrain-set-neighbors/SKILL.md new file mode 100644 index 0000000..97a7d6c --- /dev/null +++ b/.agent/skills/terrain-set-neighbors/SKILL.md @@ -0,0 +1,248 @@ +--- +name: terrain-set-neighbors +description: Set the neighboring `Terrain`s of a center `Terrain` (left / top / right / bottom) so Unity blends seams and LOD across tiles. Omitted neighbors are treated as null. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Neighbors + +Wire up the neighbor terrains of a center `Terrain` via `Terrain.SetNeighbors`. + +## Inputs + +- `gameObjectRef` — the center Terrain GameObject (required). +- `leftRef` / `topRef` / `rightRef` / `bottomRef` — optional GameObjects hosting the neighboring `Terrain`s. Any omitted side is set to null. + +## Behavior + +Resolves each provided neighbor GameObject to its `Terrain` component, calls `center.SetNeighbors(left, top, right, bottom)`, and triggers `Terrain.Flush()`. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-neighbors --input '{ + "gameObjectRef": "string_value", + "leftRef": "string_value", + "topRef": "string_value", + "rightRef": "string_value", + "bottomRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-neighbors --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-neighbors --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the center Terrain GameObject. | +| `leftRef` | `any` | No | Optional GameObject hosting the left neighbor Terrain. | +| `topRef` | `any` | No | Optional GameObject hosting the top neighbor Terrain. | +| `rightRef` | `any` | No | Optional GameObject hosting the right neighbor Terrain. | +| `bottomRef` | `any` | No | Optional GameObject hosting the bottom neighbor Terrain. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "leftRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "topRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "rightRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "bottomRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetNeighborsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetNeighborsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the center Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the center Terrain component." + }, + "left": { + "type": "string", + "description": "Name of the left neighbor, or null." + }, + "top": { + "type": "string", + "description": "Name of the top neighbor, or null." + }, + "right": { + "type": "string", + "description": "Name of the right neighbor, or null." + }, + "bottom": { + "type": "string", + "description": "Name of the bottom neighbor, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-size/SKILL.md b/.agent/skills/terrain-set-size/SKILL.md new file mode 100644 index 0000000..525142c --- /dev/null +++ b/.agent/skills/terrain-set-size/SKILL.md @@ -0,0 +1,257 @@ +--- +name: terrain-set-size +description: Set the world-space size of a `Terrain`'s `TerrainData` — width (X), height (Y), and length (Z). Omitted components keep their current value. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Size + +Set the world-space size of a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `width` — optional new width in world units (X). When omitted, the current width is kept. +- `height` — optional new height in world units (Y). When omitted, the current height is kept. +- `length` — optional new length in world units (Z). When omitted, the current length is kept. + +## Behavior + +Assigns `TerrainData.size` from the provided components (falling back to the current value for any omitted axis). Marks the asset + scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-size --input '{ + "gameObjectRef": "string_value", + "width": "string_value", + "height": "string_value", + "length": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-size --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-size --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `width` | `any` | No | Optional new terrain width in world units (X axis). | +| `height` | `any` | No | Optional new terrain height in world units (Y axis). | +| `length` | `any` | No | Optional new terrain length in world units (Z axis). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "width": { + "$ref": "#/$defs/System.Single" + }, + "height": { + "$ref": "#/$defs/System.Single" + }, + "length": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetSizeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetSizeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved terrain size (X=width, Y=height, Z=length)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "size", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/terrain-set-tree-prototypes/SKILL.md b/.agent/skills/terrain-set-tree-prototypes/SKILL.md new file mode 100644 index 0000000..79da94f --- /dev/null +++ b/.agent/skills/terrain-set-tree-prototypes/SKILL.md @@ -0,0 +1,229 @@ +--- +name: terrain-set-tree-prototypes +description: Replace the tree prototypes of a `Terrain` with a new set built from prefab/GameObject asset paths. Returns the resulting prototype count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Tree Prototypes + +Replace `TerrainData.treePrototypes` with a new set built from prefab asset paths. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `prefabAssetPaths` — list of prefab/GameObject asset paths; each becomes a `TreePrototype` (required, non-empty). + +## Behavior + +Loads each prefab, builds a `TreePrototype` with `prefab` set, assigns the array to `TerrainData.treePrototypes`, marks dirty + repaints, and returns the count. Destructive (replaces existing prototypes; existing placed tree instances may need re-placing). Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-tree-prototypes --input '{ + "gameObjectRef": "string_value", + "prefabAssetPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-tree-prototypes --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-tree-prototypes --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `prefabAssetPaths` | `any` | Yes | Prefab/GameObject asset paths; each becomes a TreePrototype. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "prefabAssetPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "gameObjectRef", + "prefabAssetPaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetTreePrototypesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetTreePrototypesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "treePrototypeCount": { + "type": "integer", + "description": "Number of tree prototypes after the set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "treePrototypeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tests-run/SKILL.md b/.agent/skills/tests-run/SKILL.md new file mode 100644 index 0000000..2c1a1ca --- /dev/null +++ b/.agent/skills/tests-run/SKILL.md @@ -0,0 +1,281 @@ +--- +name: tests-run +description: "Execute Unity tests (`EditMode` or `PlayMode`) and return per-test results. Supports filtering by test assembly, namespace, class, and method. Refreshes the AssetDatabase first; defers execution across domain reloads if scripts changed. Precondition: every open scene must be saved — dirty scenes abort the run." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tests / Run + +Execute Unity tests and return detailed results. Supports filtering by test mode, assembly, namespace, class, and method. Recommended to use 'EditMode' for faster iteration during development. Precondition: every open scene MUST be saved (no unsaved changes). If any open scene is dirty, this tool throws an InvalidOperationException listing the dirty scenes; save them and retry. + +## Filters + +- `testMode` (default `EditMode`) — `EditMode` or `PlayMode`. EditMode is faster; prefer it during iteration. +- `testAssembly` / `testNamespace` / `testClass` / `testMethod` — optional, layered filters. Namespace and class filters become regex `groupNames` so the validation count and Unity's execution stay in sync. `testMethod` must be fully qualified (`Namespace.FixtureName.TestName`). + +## Response toggles + +- `includePassingTests` (default `false`) — include details for passing tests; otherwise only failing test details are returned. +- `includeMessages` (default `true`) — include per-test result messages. +- `includeStacktrace` (default `false`) — include stack traces for failing tests. +- `includeLogs` (default `false`) — include console logs captured during the run. +- `logType` (default `Warning`) — minimum log severity to include. +- `includeLogsStacktrace` (default `false`) — include log stack traces (large payload; use sparingly). + +## Domain reloads + +If the AssetDatabase refresh triggers compilation, the tool persists the run parameters to `SessionState`, returns `Processing`, and resumes the run automatically after the reload completes. Pre-existing compilation errors short-circuit the run and return the error details so the caller can fix the project first. + +## How to Call + +```bash +unity-mcp-cli run-tool tests-run --input '{ + "testMode": "string_value", + "testAssembly": "string_value", + "testNamespace": "string_value", + "testClass": "string_value", + "testMethod": "string_value", + "includePassingTests": false, + "includeMessages": false, + "includeStacktrace": false, + "includeLogs": false, + "logType": "string_value", + "includeLogsStacktrace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tests-run --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tests-run --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `testMode` | `string` | No | Test mode to run. Options: 'EditMode', 'PlayMode'. Default: 'EditMode' | +| `testAssembly` | `string` | No | Specific test assembly name to run (optional). Example: 'Assembly-CSharp-Editor-testable' | +| `testNamespace` | `string` | No | Specific test namespace to run (optional). Example: 'MyTestNamespace' | +| `testClass` | `string` | No | Specific test class name to run (optional). Example: 'MyTestClass' | +| `testMethod` | `string` | No | Specific fully qualified test method to run (optional). Example: 'MyTestNamespace.FixtureName.TestName' | +| `includePassingTests` | `boolean` | No | Include details for all tests, both passing and failing (default: false). If you just need details for failing tests, set to false. | +| `includeMessages` | `boolean` | No | Include test result messages in the test results (default: true). If you just need pass/fail status, set to false. | +| `includeStacktrace` | `boolean` | No | Include stack traces in the test results (default: false). | +| `includeLogs` | `boolean` | No | Include console logs in the test results (default: false). | +| `logType` | `string` | No | Log type filter for console logs. Options: 'Log', 'Warning', 'Assert', 'Error', 'Exception'. (default: 'Warning') | +| `includeLogsStacktrace` | `boolean` | No | Include stack traces for console logs in the test results (default: false). This is huge amount of data, use only if really needed. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "testMode": { + "type": "string", + "enum": [ + "EditMode", + "PlayMode" + ] + }, + "testAssembly": { + "type": "string" + }, + "testNamespace": { + "type": "string" + }, + "testClass": { + "type": "string" + }, + "testMethod": { + "type": "string" + }, + "includePassingTests": { + "type": "boolean" + }, + "includeMessages": { + "type": "boolean" + }, + "includeStacktrace": { + "type": "boolean" + }, + "includeLogs": { + "type": "boolean" + }, + "logType": { + "type": "string", + "enum": [ + "Error", + "Assert", + "Warning", + "Log", + "Exception" + ] + }, + "includeLogsStacktrace": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "enum": [ + "Unknown", + "Passed", + "Failed" + ] + }, + "TotalTests": { + "type": "integer" + }, + "PassedTests": { + "type": "integer" + }, + "FailedTests": { + "type": "integer" + }, + "SkippedTests": { + "type": "integer" + }, + "Duration": { + "type": "string" + } + }, + "required": [ + "Status", + "TotalTests", + "PassedTests", + "FailedTests", + "SkippedTests", + "Duration" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Status": { + "type": "string", + "enum": [ + "Passed", + "Failed", + "Skipped" + ] + }, + "Duration": { + "type": "string" + }, + "Message": { + "type": "string" + }, + "StackTrace": { + "type": "string" + } + }, + "required": [ + "Status", + "Duration" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry": { + "type": "object", + "properties": { + "Condition": { + "type": "string" + }, + "StackTrace": { + "type": "string" + }, + "Type": { + "type": "string", + "enum": [ + "Error", + "Assert", + "Warning", + "Log", + "Exception" + ] + }, + "Timestamp": { + "type": "string", + "format": "date-time" + }, + "LogLevel": { + "type": "integer" + } + }, + "required": [ + "Type", + "Timestamp" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse": { + "type": "object", + "properties": { + "Summary": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData", + "description": "Summary of the test run including total, passed, failed, and skipped counts." + }, + "Results": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)", + "description": "List of individual test results with details about each test." + }, + "Logs": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)", + "description": "Log entries captured during test execution." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-box-fill/SKILL.md b/.agent/skills/tilemap-box-fill/SKILL.md new file mode 100644 index 0000000..5e68b50 --- /dev/null +++ b/.agent/skills/tilemap-box-fill/SKILL.md @@ -0,0 +1,284 @@ +--- +name: tilemap-box-fill +description: Fill a rectangular region of a Tilemap with a single TileBase asset using Tilemap.BoxFill. The region is defined by an inclusive min and max cell coordinate. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Box Fill + +Fill a rectangular block of cells of a `Tilemap` with one tile via `Tilemap.BoxFill`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `minX`, `minY` — inclusive minimum cell coordinate. +- `maxX`, `maxY` — inclusive maximum cell coordinate. +- `z` — cell Z coordinate (default 0). +- `tileAssetPath` — `Assets/`-rooted path to the `TileBase` asset to fill with (required). + +## Behavior + +Loads the tile, calls `Tilemap.BoxFill(start, tile, minX, minY, maxX, maxY)`, marks the scene dirty, and repaints. Returns the filled cell count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-box-fill --input '{ + "gameObjectRef": "string_value", + "tileAssetPath": "string_value", + "minX": 0, + "minY": 0, + "maxX": 0, + "maxY": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-box-fill --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-box-fill --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `tileAssetPath` | `string` | Yes | Assets/-rooted path to the TileBase asset to fill the region with. | +| `minX` | `integer` | Yes | Inclusive minimum cell X coordinate. | +| `minY` | `integer` | Yes | Inclusive minimum cell Y coordinate. | +| `maxX` | `integer` | Yes | Inclusive maximum cell X coordinate. | +| `maxY` | `integer` | Yes | Inclusive maximum cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "tileAssetPath": { + "type": "string" + }, + "minX": { + "type": "integer" + }, + "minY": { + "type": "integer" + }, + "maxX": { + "type": "integer" + }, + "maxY": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "tileAssetPath", + "minX", + "minY", + "maxX", + "maxY" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-BoxFillResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-BoxFillResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "minX": { + "type": "integer", + "description": "Resolved minimum X." + }, + "minY": { + "type": "integer", + "description": "Resolved minimum Y." + }, + "maxX": { + "type": "integer", + "description": "Resolved maximum X." + }, + "maxY": { + "type": "integer", + "description": "Resolved maximum Y." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "filledCount": { + "type": "integer", + "description": "Number of cells filled." + }, + "tileAssetPath": { + "type": "string", + "description": "Path of the tile asset used." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "minX", + "minY", + "maxX", + "maxY", + "cellZ", + "filledCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-clear/SKILL.md b/.agent/skills/tilemap-clear/SKILL.md new file mode 100644 index 0000000..3828a9d --- /dev/null +++ b/.agent/skills/tilemap-clear/SKILL.md @@ -0,0 +1,253 @@ +--- +name: tilemap-clear +description: "Clear tiles from a Tilemap: either every tile (ClearAllTiles) or a rectangular region (by erasing each cell in the inclusive min..max range). Destructive." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Clear Tiles + +Erase tiles from a `Tilemap`. By default clears the whole map; pass a region to clear only a rectangular block. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `clearAll` (bool, default true) — when true, calls `Tilemap.ClearAllTiles()`; when false, erases the region defined by `minX/minY/maxX/maxY`. +- `minX`, `minY`, `maxX`, `maxY`, `z` — the inclusive region (used only when `clearAll` is false). + +## Behavior + +Either clears all tiles or sets each cell in the region to null, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-clear --input '{ + "gameObjectRef": "string_value", + "clearAll": false, + "minX": 0, + "minY": 0, + "maxX": 0, + "maxY": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-clear --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-clear --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `clearAll` | `boolean` | No | If true (default) clear the entire Tilemap; if false, clear the min..max region only. | +| `minX` | `integer` | No | Inclusive minimum cell X (region mode). | +| `minY` | `integer` | No | Inclusive minimum cell Y (region mode). | +| `maxX` | `integer` | No | Inclusive maximum cell X (region mode). | +| `maxY` | `integer` | No | Inclusive maximum cell Y (region mode). | +| `z` | `integer` | No | Cell Z coordinate (region mode, default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clearAll": { + "type": "boolean" + }, + "minX": { + "type": "integer" + }, + "minY": { + "type": "integer" + }, + "maxX": { + "type": "integer" + }, + "maxY": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ClearResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ClearResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "clearedAll": { + "type": "boolean", + "description": "True when the whole map was cleared." + }, + "clearedCount": { + "type": "integer", + "description": "Number of cells cleared in region mode; -1 when clearedAll." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clearedAll", + "clearedCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-create-rule-tile/SKILL.md b/.agent/skills/tilemap-create-rule-tile/SKILL.md new file mode 100644 index 0000000..2b7b7e4 --- /dev/null +++ b/.agent/skills/tilemap-create-rule-tile/SKILL.md @@ -0,0 +1,118 @@ +--- +name: tilemap-create-rule-tile +description: Create a UnityEngine.RuleTile asset (from the 2D Tilemap Extras package) at an Assets/-rooted path, with an optional default Sprite. RuleTiles auto-pick sprites based on neighbour rules — paint them like any tile and add rules afterward via the Inspector or 'tilemap-modify'. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Rule Tile + +Create a `RuleTile` ScriptableObject asset (provided by `com.unity.2d.tilemap.extras`). + +## Inputs + +- `assetPath` — `Assets/`-rooted path ending in `.asset` for the new RuleTile. +- `defaultSpriteAssetPath` — optional `Assets/`-rooted path to a `Sprite` used as the RuleTile's default sprite (shown when no rule matches). + +## Behavior + +Creates the intermediate folders, instantiates a `RuleTile`, assigns the default sprite when supplied, writes the asset via `AssetDatabase.CreateAsset`, saves + refreshes, and returns the asset path. Neighbour rules can then be authored via `tilemap-modify` or the Inspector. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create-rule-tile --input '{ + "assetPath": "string_value", + "defaultSpriteAssetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create-rule-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create-rule-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets/-rooted path ending in '.asset' for the new RuleTile asset. | +| `defaultSpriteAssetPath` | `string` | No | Optional Assets/-rooted path to a Sprite used as the RuleTile default sprite. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "defaultSpriteAssetPath": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateRuleTileResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateRuleTileResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the created RuleTile asset." + }, + "defaultSpriteAssetPath": { + "type": "string", + "description": "Path of the assigned default Sprite, or null." + }, + "ruleCount": { + "type": "integer", + "description": "Number of tiling rules (0 for a fresh RuleTile)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "ruleCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-create-tile-asset/SKILL.md b/.agent/skills/tilemap-create-tile-asset/SKILL.md new file mode 100644 index 0000000..3e834d7 --- /dev/null +++ b/.agent/skills/tilemap-create-tile-asset/SKILL.md @@ -0,0 +1,205 @@ +--- +name: tilemap-create-tile-asset +description: Create a UnityEngine.Tilemaps.Tile asset at an Assets/-rooted path and assign a Sprite (loaded from a sprite asset path) plus an optional color and collider type. Returns the created asset path. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Tile Asset + +Create a `Tile` ScriptableObject asset and wire its sprite so it can be painted into a Tilemap. + +## Inputs + +- `assetPath` — `Assets/`-rooted path ending in `.asset` for the new Tile. +- `spriteAssetPath` — optional `Assets/`-rooted path to a `Sprite` asset to assign. +- `color` — optional tile color (default white). +- `colliderType` — optional `None` / `Sprite` / `Grid` (default Sprite). + +## Behavior + +Creates the intermediate folders, instantiates a `Tile`, assigns sprite/color/collider type, writes the asset via `AssetDatabase.CreateAsset`, saves + refreshes, and returns the asset path. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create-tile-asset --input '{ + "assetPath": "string_value", + "spriteAssetPath": "string_value", + "color": "string_value", + "colliderType": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create-tile-asset --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create-tile-asset --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets/-rooted path ending in '.asset' for the new Tile asset. | +| `spriteAssetPath` | `string` | No | Optional Assets/-rooted path to a Sprite asset to assign to the tile. | +| `color` | `any` | No | Optional tile color (default white). | +| `colliderType` | `string` | No | Optional collider type (default Sprite). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "spriteAssetPath": { + "type": "string" + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color" + }, + "colliderType": { + "type": "string", + "enum": [ + "None", + "Sprite", + "Grid" + ] + } + }, + "$defs": { + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateTileAssetResponse" + } + }, + "$defs": { + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateTileAssetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the created Tile asset." + }, + "spriteAssetPath": { + "type": "string", + "description": "Path of the assigned Sprite asset, or null." + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color", + "description": "Tile color." + }, + "colliderType": { + "type": "string", + "description": "Tile collider type." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "color", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-create/SKILL.md b/.agent/skills/tilemap-create/SKILL.md new file mode 100644 index 0000000..856b5f2 --- /dev/null +++ b/.agent/skills/tilemap-create/SKILL.md @@ -0,0 +1,267 @@ +--- +name: tilemap-create +description: Create a Grid GameObject with a child Tilemap + TilemapRenderer in the active scene. Optionally parent the Grid under an existing GameObject and name the tilemap. Returns the new tilemap GameObject reference and its instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Grid + Tilemap + +Create the standard 2D tilemap hierarchy: a `Grid` GameObject hosting a child GameObject with a `Tilemap` and `TilemapRenderer`. This is the minimal structure required before painting tiles. + +## Inputs + +- `gridName` — optional name for the Grid GameObject (default `Grid`). +- `tilemapName` — optional name for the Tilemap child GameObject (default `Tilemap`). +- `parentRef` — optional GameObject to parent the new Grid under. +- `cellSize` — optional Grid cell size (default `(1,1,0)`). + +## Behavior + +Creates the Grid + child Tilemap/TilemapRenderer, sets the cell size, parents under `parentRef` when supplied, marks the scene dirty, repaints, and returns references + the tilemap GameObject instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create --input '{ + "gridName": "string_value", + "tilemapName": "string_value", + "parentRef": "string_value", + "cellSize": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gridName` | `string` | No | Name of the Grid GameObject. | +| `tilemapName` | `string` | No | Name of the child Tilemap GameObject. | +| `parentRef` | `any` | No | Optional GameObject to parent the new Grid under. | +| `cellSize` | `any` | No | Grid cell size. Defaults to (1,1,0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gridName": { + "type": "string" + }, + "tilemapName": { + "type": "string" + }, + "parentRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "cellSize": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateResponse": { + "type": "object", + "properties": { + "gridRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Grid GameObject." + }, + "tilemapGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created Tilemap component." + }, + "rendererRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created TilemapRenderer component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created Tilemap GameObject." + }, + "gridName": { + "type": "string", + "description": "Name of the created Grid GameObject." + }, + "tilemapName": { + "type": "string", + "description": "Name of the created Tilemap GameObject." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-get-tile/SKILL.md b/.agent/skills/tilemap-get-tile/SKILL.md new file mode 100644 index 0000000..83be7e6 --- /dev/null +++ b/.agent/skills/tilemap-get-tile/SKILL.md @@ -0,0 +1,293 @@ +--- +name: tilemap-get-tile +description: "Read the tile occupying a single cell of a Tilemap: returns whether the cell has a tile, the tile asset name + path, the tile color, and the collider type at that cell. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Get Tile + +Inspect a single cell of a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the integer cell coordinate (z defaults to 0). + +## Behavior + +Reads `Tilemap.GetTile`, `GetColor`, and `GetColliderType` at the cell and returns them. When the cell is empty, `hasTile` is false. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-get-tile --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-get-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-get-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-GetTileResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-GetTileResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "hasTile": { + "type": "boolean", + "description": "Whether a tile occupies the cell." + }, + "tileName": { + "type": "string", + "description": "Name of the tile asset, or null when empty." + }, + "tileAssetPath": { + "type": "string", + "description": "Asset path of the tile, or null when empty/unsaved." + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color", + "description": "Per-cell tint color." + }, + "colliderType": { + "type": "string", + "description": "Per-cell collider type (None/Sprite/Grid)." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "hasTile", + "color" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-get/SKILL.md b/.agent/skills/tilemap-get/SKILL.md new file mode 100644 index 0000000..d2ba3c0 --- /dev/null +++ b/.agent/skills/tilemap-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: tilemap-get +description: "Generic read: serialize a Tilemap-related `Component` (Tilemap, TilemapRenderer, Grid, or a Tile/RuleTile asset's host) on a GameObject via ReflectorNet. Pair with 'tilemap-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Get Component + +Serialize any Tilemap-related component on a GameObject using ReflectorNet. This is the generic escape hatch for fields/properties not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Tilemap-related component; otherwise the first `Tilemap` / `TilemapRenderer` / `Grid` is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap-related component. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-list/SKILL.md b/.agent/skills/tilemap-list/SKILL.md new file mode 100644 index 0000000..d2dd636 --- /dev/null +++ b/.agent/skills/tilemap-list/SKILL.md @@ -0,0 +1,226 @@ +--- +name: tilemap-list +description: List every Tilemap in the active scene with its name, painted-tile count, cell bounds, and orientation. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / List Tilemaps + +Enumerate all `Tilemap` components in the active scene. + +## Inputs + +- `includeInactive` (bool, default true) — include Tilemaps on inactive GameObjects. + +## Behavior + +Finds all `Tilemap` instances, reads each one's `GetUsedTilesCount`, `cellBounds`, and `orientation`, and returns them. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include Tilemaps on inactive GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "name": { + "type": "string", + "description": "Name of the Tilemap GameObject." + }, + "tileCount": { + "type": "integer", + "description": "Number of painted (used) tiles." + }, + "boundsMin": { + "$ref": "#/$defs/UnityEngine.Vector3Int", + "description": "Inclusive minimum cell bound." + }, + "boundsMax": { + "$ref": "#/$defs/UnityEngine.Vector3Int", + "description": "Exclusive maximum cell bound." + }, + "orientation": { + "type": "string", + "description": "Layout orientation." + } + }, + "required": [ + "tileCount", + "boundsMin", + "boundsMax" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3Int": { + "type": "object", + "properties": { + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of Tilemaps found." + }, + "tilemaps": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem-1", + "description": "The Tilemaps in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-modify/SKILL.md b/.agent/skills/tilemap-modify/SKILL.md new file mode 100644 index 0000000..f15a978 --- /dev/null +++ b/.agent/skills/tilemap-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: tilemap-modify +description: "Generic write: apply a `SerializedMember` diff to a Tilemap-related `Component` on a GameObject via ReflectorNet `TryModify`. Fields go through the `fields` channel, properties through `props`. Use 'tilemap-get' first to inspect the structure." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Modify Component + +Modify a Tilemap-related component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for members not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Route C# **fields** through the `fields` channel and **properties** through `props` — ReflectorNet resolves each channel strictly with no cross-fallback. +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one. + +## Behavior + +Finds the target component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap-related component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-set-collider-type/SKILL.md b/.agent/skills/tilemap-set-collider-type/SKILL.md new file mode 100644 index 0000000..3cf6282 --- /dev/null +++ b/.agent/skills/tilemap-set-collider-type/SKILL.md @@ -0,0 +1,260 @@ +--- +name: tilemap-set-collider-type +description: Set the per-cell Tile.ColliderType (None / Sprite / Grid) of a tile painted into a Tilemap. Pair with a TilemapCollider2D to generate physics colliders from the tiles. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile Collider Type + +Override the collider type of a single tile cell in a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the cell coordinate (z defaults to 0). +- `colliderType` — `None`, `Sprite`, or `Grid`. + +## Behavior + +Maps the argument to `UnityEngine.Tilemaps.Tile.ColliderType` and calls `Tilemap.SetColliderType`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-collider-type --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "colliderType": "string_value", + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-collider-type --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-collider-type --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `colliderType` | `string` | Yes | The collider type to set: None, Sprite, or Grid. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "colliderType": { + "type": "string", + "enum": [ + "None", + "Sprite", + "Grid" + ] + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y", + "colliderType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetColliderTypeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetColliderTypeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "colliderType": { + "type": "string", + "description": "Resulting collider type." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-set-orientation/SKILL.md b/.agent/skills/tilemap-set-orientation/SKILL.md new file mode 100644 index 0000000..1b9296c --- /dev/null +++ b/.agent/skills/tilemap-set-orientation/SKILL.md @@ -0,0 +1,294 @@ +--- +name: tilemap-set-orientation +description: Set the tile anchor (sub-cell pivot, default (0.5,0.5,0)) and/or the layout orientation (XY/XZ/YX/YZ/ZX/ZY/Custom) of a Tilemap. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Anchor + Orientation + +Configure how a `Tilemap` positions and orients its tiles. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `anchor` — optional sub-cell anchor (tile pivot within a cell), default `(0.5,0.5,0)`. +- `orientation` — optional layout plane: `XY` (default 2D), `XZ`, `YX`, `YZ`, `ZX`, `ZY`, `Custom`. + +## Behavior + +Sets `Tilemap.tileAnchor` and/or `Tilemap.orientation`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-orientation --input '{ + "gameObjectRef": "string_value", + "anchor": "string_value", + "orientation": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-orientation --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-orientation --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `anchor` | `any` | No | Optional sub-cell tile anchor (default (0.5,0.5,0)). | +| `orientation` | `any` | No | Optional layout orientation plane. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "anchor": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "orientation": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapOrientation" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapOrientation": { + "type": "string", + "enum": [ + "XY", + "XZ", + "YX", + "YZ", + "ZX", + "ZY", + "Custom" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetOrientationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetOrientationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "tileAnchor": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resulting tile anchor." + }, + "orientation": { + "type": "string", + "description": "Resulting orientation." + }, + "anchorApplied": { + "type": "boolean", + "description": "True when the anchor was changed." + }, + "orientationApplied": { + "type": "boolean", + "description": "True when the orientation was changed." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "tileAnchor", + "anchorApplied", + "orientationApplied", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-set-tile-flags/SKILL.md b/.agent/skills/tilemap-set-tile-flags/SKILL.md new file mode 100644 index 0000000..d9782eb --- /dev/null +++ b/.agent/skills/tilemap-set-tile-flags/SKILL.md @@ -0,0 +1,341 @@ +--- +name: tilemap-set-tile-flags +description: Set the per-cell tint color and/or transform (flip X/Y, Z rotation, scale) of a tile already painted into a Tilemap. Unlocks the relevant TileFlags so the overrides take effect. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile Color + Transform + +Override the per-cell color and transform of a single tile in a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the cell coordinate (z defaults to 0). +- `color` — optional per-cell tint color; unlocks `TileFlags.LockColor` when applied. +- `flipX`, `flipY` — optional booleans to mirror the tile. +- `rotationZ` — optional Z rotation in degrees. +- `scale` — optional uniform/again per-axis scale (default identity). + +## Behavior + +When a color is given, removes `TileFlags.LockColor` then calls `SetColor`. When any transform argument is given, removes `TileFlags.LockTransform` then builds a TRS matrix and calls `SetTransformMatrix`. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-tile-flags --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0, + "color": "string_value", + "flipX": "string_value", + "flipY": "string_value", + "rotationZ": "string_value", + "scale": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile-flags --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile-flags --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | +| `color` | `any` | No | Optional per-cell tint color. | +| `flipX` | `any` | No | Optional: mirror the tile horizontally. | +| `flipY` | `any` | No | Optional: mirror the tile vertically. | +| `rotationZ` | `any` | No | Optional: Z rotation in degrees. | +| `scale` | `any` | No | Optional per-axis scale (default (1,1,1)). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color" + }, + "flipX": { + "$ref": "#/$defs/System.Boolean" + }, + "flipY": { + "$ref": "#/$defs/System.Boolean" + }, + "rotationZ": { + "$ref": "#/$defs/System.Single" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "System.Boolean": { + "type": "boolean" + }, + "System.Single": { + "type": "number" + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileFlagsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileFlagsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "colorApplied": { + "type": "boolean", + "description": "True when a color override was applied." + }, + "transformApplied": { + "type": "boolean", + "description": "True when a transform override was applied." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "colorApplied", + "transformApplied", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tilemap-set-tile/SKILL.md b/.agent/skills/tilemap-set-tile/SKILL.md new file mode 100644 index 0000000..dbd0d83 --- /dev/null +++ b/.agent/skills/tilemap-set-tile/SKILL.md @@ -0,0 +1,259 @@ +--- +name: tilemap-set-tile +description: Paint a single tile (a TileBase asset such as a Tile or RuleTile) into a Tilemap at a given cell coordinate. Pass a null/empty tileAssetPath to erase the cell. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile + +Set the tile at a single cell of a `Tilemap`. The tile is loaded from an `Assets/`-rooted path to any `TileBase` asset (a `Tile`, `RuleTile`, etc.). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the integer cell coordinate (z defaults to 0). +- `tileAssetPath` — `Assets/`-rooted path to the `TileBase` asset; null/empty erases the cell. + +## Behavior + +Loads the tile asset (when supplied), calls `Tilemap.SetTile(cell, tile)`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-tile --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0, + "tileAssetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | +| `tileAssetPath` | `string` | No | Assets/-rooted path to the TileBase asset to paint. Null/empty erases the cell. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + }, + "tileAssetPath": { + "type": "string" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "tileAssetPath": { + "type": "string", + "description": "Path of the painted tile asset, or null." + }, + "erased": { + "type": "boolean", + "description": "True when the cell was erased (no tile painted)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "erased", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-clip-add/SKILL.md b/.agent/skills/timeline-clip-add/SKILL.md new file mode 100644 index 0000000..757c1af --- /dev/null +++ b/.agent/skills/timeline-clip-add/SKILL.md @@ -0,0 +1,176 @@ +--- +name: timeline-clip-add +description: Add a clip to a track on a `TimelineAsset`. For AnimationTracks pass an `animationClipPath`; for AudioTracks pass an `audioClipPath`; otherwise a default clip is created. Optionally set start, duration and display name. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Clip + +Add a clip to a track. The clip type depends on the track: an `AnimationTrack` hosts an `AnimationClip`, an `AudioTrack` hosts an `AudioClip`, and other tracks get a default clip. When no source asset is supplied a default (empty) clip is created. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track to add the clip to (name wins; index default 0). +- `animationClipPath` — optional Assets path to an `AnimationClip` (AnimationTrack only). +- `audioClipPath` — optional Assets path to an `AudioClip` (AudioTrack only). +- `start` — optional clip start time in seconds (default 0). +- `duration` — optional clip duration in seconds; when > 0 overrides the default duration. +- `displayName` — optional clip display name. + +## Behavior + +Resolves the track, creates the appropriate clip (typed when a source asset is given, else a default clip), applies start/duration/name, saves the asset, and returns the new clip's index and timing. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-add --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "animationClipPath": "string_value", + "audioClipPath": "string_value", + "start": 0, + "duration": 0, + "displayName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Name of the target track. Takes precedence over trackIndex when provided. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `animationClipPath` | `string` | No | Optional Assets path to an AnimationClip (used for AnimationTracks). | +| `audioClipPath` | `string` | No | Optional Assets path to an AudioClip (used for AudioTracks). | +| `start` | `number` | No | Clip start time in seconds (default 0). | +| `duration` | `number` | No | Clip duration in seconds; when > 0 overrides the default duration. | +| `displayName` | `string` | No | Optional clip display name. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "animationClipPath": { + "type": "string" + }, + "audioClipPath": { + "type": "string" + }, + "start": { + "type": "number" + }, + "duration": { + "type": "number" + }, + "displayName": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track the clip was added to." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the new clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Clip start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds." + }, + "end": { + "type": "number", + "description": "Clip end time in seconds." + }, + "assetType": { + "type": "string", + "description": "Type name of the clip's PlayableAsset, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "start", + "duration", + "end", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-clip-move/SKILL.md b/.agent/skills/timeline-clip-move/SKILL.md new file mode 100644 index 0000000..551b22e --- /dev/null +++ b/.agent/skills/timeline-clip-move/SKILL.md @@ -0,0 +1,167 @@ +--- +name: timeline-clip-move +description: Move a clip along its track — either to an absolute `start` time or by a relative `deltaSeconds`. Duration is preserved. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Move Clip + +Reposition a clip on its track without changing its duration. Provide either an absolute `start` or a relative `deltaSeconds` (delta is ignored when `start` is supplied). + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track holds the clip (name wins; index default 0). +- `clipIndex` — required zero-based clip index. +- `start` — optional absolute new start time (seconds). +- `deltaSeconds` — optional relative shift (seconds); used only when `start` is null. + +## Behavior + +Computes the new start (clamped to >= 0), sets `clip.start`, saves the asset, and returns the old and new start. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-move --input '{ + "assetPath": "string_value", + "clipIndex": 0, + "trackName": "string_value", + "trackIndex": 0, + "start": "string_value", + "deltaSeconds": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-move --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-move --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `clipIndex` | `integer` | Yes | Zero-based index of the clip on its track. | +| `trackName` | `string` | No | Name of the track holding the clip. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `start` | `any` | No | Optional absolute new start time in seconds. | +| `deltaSeconds` | `number` | No | Optional relative shift in seconds; used only when start is null. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "clipIndex": { + "type": "integer" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "start": { + "$ref": "#/$defs/System.Double" + }, + "deltaSeconds": { + "type": "number" + } + }, + "$defs": { + "System.Double": { + "type": "number" + } + }, + "required": [ + "assetPath", + "clipIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipMoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipMoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track holding the clip." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the clip on its track." + }, + "oldStart": { + "type": "number", + "description": "Previous start time in seconds." + }, + "newStart": { + "type": "number", + "description": "New start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds (unchanged)." + }, + "end": { + "type": "number", + "description": "New end time in seconds." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "oldStart", + "newStart", + "duration", + "end", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-clip-set-timing/SKILL.md b/.agent/skills/timeline-clip-set-timing/SKILL.md new file mode 100644 index 0000000..9b9cb1f --- /dev/null +++ b/.agent/skills/timeline-clip-set-timing/SKILL.md @@ -0,0 +1,220 @@ +--- +name: timeline-clip-set-timing +description: "Set the timing of a clip on a Timeline track: start, duration, clip-in (trim), blend-in / blend-out durations, ease-in / ease-out durations, and time scale. Only the values you supply are changed." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Set Clip Timing + +Adjust the timing of an existing clip identified by track + clip index. Any value left null is untouched, so this tool can tweak a single property or several at once. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track holds the clip (name wins; index default 0). +- `clipIndex` — required zero-based index of the clip on its track. +- `start` — optional new start time (seconds). +- `duration` — optional new duration (seconds). +- `clipIn` — optional clip-in / trim offset into the source asset (seconds). +- `blendInDuration` / `blendOutDuration` — optional crossfade blend durations (seconds). +- `easeInDuration` / `easeOutDuration` — optional ease (fade) durations (seconds). +- `timeScale` — optional playback time scale of the clip. + +## Behavior + +Resolves the clip, applies each supplied value, saves the asset, and returns the resulting timing. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-set-timing --input '{ + "assetPath": "string_value", + "clipIndex": 0, + "trackName": "string_value", + "trackIndex": 0, + "start": "string_value", + "duration": "string_value", + "clipIn": "string_value", + "blendInDuration": "string_value", + "blendOutDuration": "string_value", + "easeInDuration": "string_value", + "easeOutDuration": "string_value", + "timeScale": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-set-timing --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-set-timing --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `clipIndex` | `integer` | Yes | Zero-based index of the clip on its track. | +| `trackName` | `string` | No | Name of the track holding the clip. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `start` | `any` | No | Optional new start time in seconds. | +| `duration` | `any` | No | Optional new duration in seconds. | +| `clipIn` | `any` | No | Optional clip-in (trim offset into the source asset) in seconds. | +| `blendInDuration` | `any` | No | Optional blend-in (crossfade) duration in seconds. | +| `blendOutDuration` | `any` | No | Optional blend-out (crossfade) duration in seconds. | +| `easeInDuration` | `any` | No | Optional ease-in (fade) duration in seconds. | +| `easeOutDuration` | `any` | No | Optional ease-out (fade) duration in seconds. | +| `timeScale` | `any` | No | Optional playback time scale of the clip. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "clipIndex": { + "type": "integer" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "start": { + "$ref": "#/$defs/System.Double" + }, + "duration": { + "$ref": "#/$defs/System.Double" + }, + "clipIn": { + "$ref": "#/$defs/System.Double" + }, + "blendInDuration": { + "$ref": "#/$defs/System.Double" + }, + "blendOutDuration": { + "$ref": "#/$defs/System.Double" + }, + "easeInDuration": { + "$ref": "#/$defs/System.Double" + }, + "easeOutDuration": { + "$ref": "#/$defs/System.Double" + }, + "timeScale": { + "$ref": "#/$defs/System.Double" + } + }, + "$defs": { + "System.Double": { + "type": "number" + } + }, + "required": [ + "assetPath", + "clipIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipTimingResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipTimingResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track holding the clip." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Resulting start time in seconds." + }, + "duration": { + "type": "number", + "description": "Resulting duration in seconds." + }, + "end": { + "type": "number", + "description": "Resulting end time in seconds." + }, + "clipIn": { + "type": "number", + "description": "Resulting clip-in (trim) in seconds." + }, + "blendInDuration": { + "type": "number", + "description": "Resulting blend-in duration in seconds." + }, + "blendOutDuration": { + "type": "number", + "description": "Resulting blend-out duration in seconds." + }, + "timeScale": { + "type": "number", + "description": "Resulting time scale of the clip." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "start", + "duration", + "end", + "clipIn", + "blendInDuration", + "blendOutDuration", + "timeScale", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-create/SKILL.md b/.agent/skills/timeline-create/SKILL.md new file mode 100644 index 0000000..b1f989c --- /dev/null +++ b/.agent/skills/timeline-create/SKILL.md @@ -0,0 +1,134 @@ +--- +name: timeline-create +description: Create a new empty `TimelineAsset` (.playable) at a project path. Optionally set the frame rate and a fixed duration mode. Returns the created asset path and GUID. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Create TimelineAsset + +Create a new `TimelineAsset` and save it to disk at an `Assets/`-rooted `.playable` path. A `TimelineAsset` is the authoring container holding tracks, clips, and markers for a cutscene or sequence; a scene `PlayableDirector` plays it. + +## Inputs + +- `assetPath` — required `Assets/...`-rooted path ending in `.playable`. Missing folders are created. +- `frameRate` — optional editor frame rate of the timeline (default 60). +- `durationMode` — optional `BasedOnClips` (default) or `FixedLength`. +- `fixedDuration` — optional duration in seconds, used when `durationMode` is `FixedLength`. + +## Behavior + +Creates the intermediate folders, instantiates a `TimelineAsset`, applies the editor settings, writes it via `AssetDatabase.CreateAsset`, saves, and returns the path + GUID. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-create --input '{ + "assetPath": "string_value", + "frameRate": 0, + "durationMode": "string_value", + "fixedDuration": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path ending in '.playable' (e.g. 'Assets/Timelines/Intro.playable'). | +| `frameRate` | `number` | No | Editor frame rate of the timeline (default 60). | +| `durationMode` | `string` | No | Duration mode: 'BasedOnClips' (default) or 'FixedLength'. | +| `fixedDuration` | `number` | No | Fixed duration in seconds, used only when durationMode is 'FixedLength'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "frameRate": { + "type": "number" + }, + "durationMode": { + "type": "string" + }, + "fixedDuration": { + "type": "number" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-CreateResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-CreateResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the created TimelineAsset." + }, + "guid": { + "type": "string", + "description": "GUID of the created asset." + }, + "frameRate": { + "type": "number", + "description": "Resolved editor frame rate of the timeline." + }, + "durationMode": { + "type": "string", + "description": "Resolved duration mode." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "frameRate", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-director-bind/SKILL.md b/.agent/skills/timeline-director-bind/SKILL.md new file mode 100644 index 0000000..0d5c799 --- /dev/null +++ b/.agent/skills/timeline-director-bind/SKILL.md @@ -0,0 +1,241 @@ +--- +name: timeline-director-bind +description: Bind a `TimelineAsset` to a scene GameObject's `PlayableDirector` (adding the component if missing). Optionally set the play-on-awake flag. Returns the director's GameObject and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Bind PlayableDirector + +Assign a `TimelineAsset` as the playable of a scene `PlayableDirector` so the timeline can be played at runtime/in the editor. If the GameObject has no `PlayableDirector`, one is added. + +## Inputs + +- `gameObjectRef` — the scene GameObject to host/own the `PlayableDirector` (required). +- `assetPath` — the `.playable` TimelineAsset to bind (required). +- `playOnAwake` — optional flag to set `PlayableDirector.playOnAwake`. + +## Behavior + +Resolves the GameObject, ensures a `PlayableDirector`, sets `playableAsset` to the loaded `TimelineAsset`, applies `playOnAwake` when provided, marks the scene dirty, and returns the director GameObject reference + instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-director-bind --input '{ + "gameObjectRef": "string_value", + "assetPath": "string_value", + "playOnAwake": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-director-bind --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-director-bind --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the scene GameObject that should own the PlayableDirector. | +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable) to bind. | +| `playOnAwake` | `any` | No | Optional value for PlayableDirector.playOnAwake. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "assetPath": { + "type": "string" + }, + "playOnAwake": { + "$ref": "#/$defs/System.Boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Boolean": { + "type": "boolean" + } + }, + "required": [ + "gameObjectRef", + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-DirectorBindResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-DirectorBindResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the PlayableDirector." + }, + "directorRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the PlayableDirector component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the director GameObject." + }, + "assetPath": { + "type": "string", + "description": "Project path of the bound TimelineAsset." + }, + "playOnAwake": { + "type": "boolean", + "description": "Resulting playOnAwake flag." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "playOnAwake", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-get/SKILL.md b/.agent/skills/timeline-get/SKILL.md new file mode 100644 index 0000000..c81a7d8 --- /dev/null +++ b/.agent/skills/timeline-get/SKILL.md @@ -0,0 +1,173 @@ +--- +name: timeline-get +description: "Generic read: serialize a Timeline object via ReflectorNet — the `TimelineAsset` itself, a `TrackAsset` (by name/index), or a clip's `PlayableAsset` (track + clipIndex). Pair with 'timeline-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Get Object + +Serialize a Timeline object via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools (e.g. an `AnimationPlayableAsset`'s settings or a track's mixer properties). + +## Inputs + +- `assetPath` — required `.playable` TimelineAsset path. +- `trackName` / `trackIndex` — when set, target a track instead of the whole asset. +- `clipIndex` — when >= 0 (and a track is selected), target that clip's `PlayableAsset`. +- `deepSerialization` — when `true`, recurse through nested objects. + +## Behavior + +Resolves the target object (asset / track / clip asset), serializes it via ReflectorNet, and returns the serialized member plus the resolved type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-get --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "clipIndex": 0, + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Optional track name to target a track instead of the asset. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and a track target is wanted (-1 = asset only). | +| `clipIndex` | `integer` | No | Clip index to target that clip's PlayableAsset (-1 = the track/asset itself). | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "clipIndex": { + "type": "integer" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineGetResponse" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineGetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "targetKind": { + "type": "string", + "description": "Kind of the serialized target: TimelineAsset, TrackAsset, or ClipAsset." + }, + "targetType": { + "type": "string", + "description": "Full type name of the serialized target." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized target data." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-list/SKILL.md b/.agent/skills/timeline-list/SKILL.md new file mode 100644 index 0000000..641a1c6 --- /dev/null +++ b/.agent/skills/timeline-list/SKILL.md @@ -0,0 +1,131 @@ +--- +name: timeline-list +description: List every `TimelineAsset` in the project with its path, GUID, track count and duration. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / List TimelineAssets + +Search the project AssetDatabase for `TimelineAsset` (.playable) assets and report each one's path, GUID, track count, and computed duration. + +## Inputs + +- `includeTrackCount` (bool, default true) — when true, load each asset to count its output tracks; when false, skip loading (faster, no counts). + +## Behavior + +Runs `AssetDatabase.FindAssets("t:TimelineAsset")`, resolves each to a path, and (optionally) loads it for track count + duration. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-list --input '{ + "includeTrackCount": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeTrackCount` | `boolean` | No | If true (default), load each asset to report its track count and duration; if false, skip loading. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeTrackCount": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "guid": { + "type": "string", + "description": "Asset GUID." + }, + "trackCount": { + "type": "integer", + "description": "Number of output tracks (0 when includeTrackCount is false)." + }, + "duration": { + "type": "number", + "description": "Computed duration in seconds (0 when includeTrackCount is false)." + } + }, + "required": [ + "trackCount", + "duration" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of TimelineAssets found." + }, + "timelines": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem-1", + "description": "The TimelineAssets in the project." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-marker-add/SKILL.md b/.agent/skills/timeline-marker-add/SKILL.md new file mode 100644 index 0000000..a44b1a7 --- /dev/null +++ b/.agent/skills/timeline-marker-add/SKILL.md @@ -0,0 +1,152 @@ +--- +name: timeline-marker-add +description: Add a marker at a time on a track (or the timeline marker track). `markerType` accepts 'Signal' (a SignalEmitter, default) or a full IMarker/ScriptableObject marker type name. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Marker + +Add a marker at a given time. By default a `SignalEmitter` is created (the standard Timeline signal marker). A full marker type name can be supplied to create a custom marker. The marker is placed on the named track, or on the timeline's marker track when no track is given. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `time` — required marker time in seconds. +- `markerType` — 'Signal' (default) or a full marker type name (must implement `IMarker`). +- `trackName` — optional track to host the marker; when null, the timeline's marker track is used. +- `trackIndex` — root-track index used when `trackName` is null AND `useMarkerTrack` is false. +- `useMarkerTrack` — when true (default), null trackName means the timeline marker track; when false, the marker is placed on the track at `trackIndex`. + +## Behavior + +Resolves the marker holder (a `TrackAsset` or the timeline's marker track), creates the marker via `CreateMarker`, sets its time, saves the asset, and returns the marker type and time. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-marker-add --input '{ + "assetPath": "string_value", + "time": 0, + "markerType": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "useMarkerTrack": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-marker-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-marker-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `time` | `number` | Yes | Marker time in seconds. | +| `markerType` | `string` | No | Marker type: 'Signal' (default) or a full marker type name implementing IMarker. | +| `trackName` | `string` | No | Optional track to host the marker. Takes precedence over the marker-track / index logic. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and useMarkerTrack is false. | +| `useMarkerTrack` | `boolean` | No | When true (default), a null trackName targets the timeline's marker track; when false, the track at trackIndex. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "time": { + "type": "number" + }, + "markerType": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "useMarkerTrack": { + "type": "boolean" + } + }, + "required": [ + "assetPath", + "time" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-MarkerAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-MarkerAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "holderTrackName": { + "type": "string", + "description": "Name of the track (or marker track) the marker was placed on." + }, + "markerType": { + "type": "string", + "description": "Type name of the created marker." + }, + "time": { + "type": "number", + "description": "Marker time in seconds." + }, + "markerCountOnHolder": { + "type": "integer", + "description": "Number of markers on the holding track after adding." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "time", + "markerCountOnHolder", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-modify/SKILL.md b/.agent/skills/timeline-modify/SKILL.md new file mode 100644 index 0000000..6240b38 --- /dev/null +++ b/.agent/skills/timeline-modify/SKILL.md @@ -0,0 +1,189 @@ +--- +name: timeline-modify +description: "Generic write: apply a `SerializedMember` diff to a Timeline object (the `TimelineAsset`, a `TrackAsset`, or a clip's `PlayableAsset`) via ReflectorNet `TryModify`. Use 'timeline-get' first to inspect the structure. Remember: object *fields* must be supplied through the `fields` channel and *properties* through `props` — there is no cross-fallback." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Modify Object + +Modify a Timeline object by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for members not covered by the dedicated tools. + +## Inputs + +- `assetPath` — required `.playable` TimelineAsset path. +- `data` — the `SerializedMember` diff to apply. Put C# *fields* in the `fields` array and *properties* in the `props` array; ReflectorNet resolves them on separate channels with no fallback. +- `trackName` / `trackIndex` — when set, target a track instead of the whole asset. +- `clipIndex` — when >= 0 (and a track is selected), target that clip's `PlayableAsset`. + +## Behavior + +Resolves the target, applies the diff via `Reflector.TryModify`, and on success marks the asset dirty and saves. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-modify --input '{ + "assetPath": "string_value", + "data": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "clipIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `data` | `any` | Yes | The SerializedMember diff to apply. Fields go in 'fields', properties in 'props'. | +| `trackName` | `string` | No | Optional track name to target a track instead of the asset. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and a track target is wanted (-1 = asset only). | +| `clipIndex` | `integer` | No | Clip index to target that clip's PlayableAsset (-1 = the track/asset itself). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "clipIndex": { + "type": "integer" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "assetPath", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineModifyResponse" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "targetKind": { + "type": "string", + "description": "Kind of the modified target: TimelineAsset, TrackAsset, or ClipAsset." + }, + "targetType": { + "type": "string", + "description": "Full type name of the modified target." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-track-add/SKILL.md b/.agent/skills/timeline-track-add/SKILL.md new file mode 100644 index 0000000..fd8f476 --- /dev/null +++ b/.agent/skills/timeline-track-add/SKILL.md @@ -0,0 +1,139 @@ +--- +name: timeline-track-add +description: Add a track to a `TimelineAsset`. `trackType` accepts a kind keyword (Animation, Activation, Audio, Signal, Control, Playable, Group) or a full TrackAsset type name. Optionally nest the new track under an existing GroupTrack. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Track + +Add a new track to a `TimelineAsset`. Tracks are the lanes a timeline plays: an `AnimationTrack` drives an Animator, an `ActivationTrack` toggles a GameObject active, an `AudioTrack` plays clips, a `SignalTrack` emits signals, a `ControlTrack` drives nested directors/particles, and a `GroupTrack` organizes other tracks. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackType` — required kind keyword or full TrackAsset type name. +- `trackName` — optional display name for the new track. +- `parentGroupName` — optional name of an existing GroupTrack to nest the new track under. + +## Behavior + +Resolves the track type, creates the track via `TimelineAsset.CreateTrack`, parents it under the named group when provided, saves the asset, and returns the new track's name, type and root index. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-add --input '{ + "assetPath": "string_value", + "trackType": "string_value", + "trackName": "string_value", + "parentGroupName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackType` | `string` | Yes | Track kind keyword (Animation/Activation/Audio/Signal/Control/Playable/Group) or full TrackAsset type name. | +| `trackName` | `string` | No | Optional display name for the new track. | +| `parentGroupName` | `string` | No | Optional name of an existing GroupTrack to nest the new track under. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackType": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "parentGroupName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "trackType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the created track." + }, + "trackType": { + "type": "string", + "description": "Type name of the created track." + }, + "rootIndex": { + "type": "integer", + "description": "Index of the track among the root tracks (-1 if nested under a group)." + }, + "parentGroup": { + "type": "string", + "description": "Name of the parent GroupTrack, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "rootIndex", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-track-bind/SKILL.md b/.agent/skills/timeline-track-bind/SKILL.md new file mode 100644 index 0000000..f2c5291 --- /dev/null +++ b/.agent/skills/timeline-track-bind/SKILL.md @@ -0,0 +1,220 @@ +--- +name: timeline-track-bind +description: Bind a scene object to a Timeline output track via a `PlayableDirector` generic binding — e.g. point an AnimationTrack at an `Animator`, or an ActivationTrack at a GameObject. The director must already play the timeline that owns the track. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Bind Track + +Set the scene-object binding for a specific output track on a `PlayableDirector`. The director's `playableAsset` must be the `TimelineAsset` that owns the track. For an `AnimationTrack` the binding is typically an `Animator`; for an `ActivationTrack`/`AudioTrack` it is the GameObject / AudioSource that the track drives. + +## Inputs + +- `directorRef` — GameObject hosting the `PlayableDirector` that plays the timeline (required). +- `trackName` / `trackIndex` — which output track to bind (name wins; index default 0). +- `targetRef` — the scene GameObject to bind to the track. When the track expects a `Component` (e.g. Animator/AudioSource), the matching component on this GameObject is used; otherwise the GameObject itself is bound. +- `clearBinding` — when true, clears the binding instead of setting it (ignored if `targetRef` is given). + +## Behavior + +Resolves the director and its timeline, finds the track, computes the binding object (component when the track output type is a Component, else the GameObject), calls `SetGenericBinding`, marks the scene dirty, and returns the bound object's name. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-bind --input '{ + "directorRef": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "targetRef": "string_value", + "clearBinding": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-bind --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-bind --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `directorRef` | `any` | Yes | Reference to the GameObject hosting the PlayableDirector that plays the timeline. | +| `trackName` | `string` | No | Name of the output track to bind. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `targetRef` | `any` | No | Scene GameObject to bind to the track (its matching component is used when the track expects one). | +| `clearBinding` | `boolean` | No | If true, clears the track binding (ignored when targetRef is provided). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "directorRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "targetRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clearBinding": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "directorRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackBindResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackBindResponse": { + "type": "object", + "properties": { + "directorRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the PlayableDirector." + }, + "trackName": { + "type": "string", + "description": "Name of the bound track." + }, + "boundTo": { + "type": "string", + "description": "Name of the bound object, or null when cleared." + }, + "boundType": { + "type": "string", + "description": "Type name of the bound object, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-track-list/SKILL.md b/.agent/skills/timeline-track-list/SKILL.md new file mode 100644 index 0000000..b6bead2 --- /dev/null +++ b/.agent/skills/timeline-track-list/SKILL.md @@ -0,0 +1,223 @@ +--- +name: timeline-track-list +description: List the tracks of a `TimelineAsset` — name, type, mute/lock state, clip count, and each track's clips (with timing). Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / List Tracks + +List the tracks of a `TimelineAsset`. For each output track returns its name, type, muted / locked flags, clip count, and (optionally) the clips with their timing. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `includeClips` — when `true` (default) include each track's clip list; when `false`, counts only. + +## Behavior + +Enumerates `TimelineAsset.GetOutputTracks()` and reports each track. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-list --input '{ + "assetPath": "string_value", + "includeClips": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `includeClips` | `boolean` | No | If true (default), include each track's clips and their timing; if false, only counts. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "includeClips": { + "type": "boolean" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Track name." + }, + "trackType": { + "type": "string", + "description": "Track type name." + }, + "isRoot": { + "type": "boolean", + "description": "Whether the track is a root (top-level) track." + }, + "rootIndex": { + "type": "integer", + "description": "Root-track index, or -1 when nested in a group." + }, + "muted": { + "type": "boolean", + "description": "Whether the track is muted." + }, + "locked": { + "type": "boolean", + "description": "Whether the track is locked." + }, + "clipCount": { + "type": "integer", + "description": "Number of clips on the track." + }, + "clips": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo-1", + "description": "The clips on the track (empty when includeClips is false)." + } + }, + "required": [ + "isRoot", + "rootIndex", + "muted", + "locked", + "clipCount" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Zero-based index of the clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Clip start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds." + }, + "end": { + "type": "number", + "description": "Clip end time in seconds." + }, + "blendInDuration": { + "type": "number", + "description": "Blend-in duration in seconds." + }, + "blendOutDuration": { + "type": "number", + "description": "Blend-out duration in seconds." + }, + "assetType": { + "type": "string", + "description": "Type name of the clip's PlayableAsset, or null." + } + }, + "required": [ + "index", + "start", + "duration", + "end", + "blendInDuration", + "blendOutDuration" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackListResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "durationMode": { + "type": "string", + "description": "Duration mode of the timeline." + }, + "duration": { + "type": "number", + "description": "Computed duration of the timeline in seconds." + }, + "count": { + "type": "integer", + "description": "Number of output tracks." + }, + "tracks": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo-1", + "description": "The output tracks of the timeline." + } + }, + "required": [ + "duration", + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/timeline-track-remove/SKILL.md b/.agent/skills/timeline-track-remove/SKILL.md new file mode 100644 index 0000000..2c9fae4 --- /dev/null +++ b/.agent/skills/timeline-track-remove/SKILL.md @@ -0,0 +1,128 @@ +--- +name: timeline-track-remove +description: Remove a root track (and its clips/markers) from a `TimelineAsset`, identified by `trackName` or by `trackIndex`. Destructive. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Remove Track + +Remove a track from a `TimelineAsset`. The track is identified by name (preferred) or by its root index. All clips and markers on the track are deleted with it. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` — name of the track to remove. When provided, takes precedence over `trackIndex`. +- `trackIndex` — zero-based root-track index used when `trackName` is null/empty (default 0). + +## Behavior + +Resolves the track, deletes it via `TimelineAsset.DeleteTrack`, saves the asset, and returns the remaining track count. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-remove --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Name of the track to remove. Takes precedence over trackIndex when provided. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackRemoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackRemoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "removedTrackName": { + "type": "string", + "description": "Name of the removed track." + }, + "removedTrackType": { + "type": "string", + "description": "Type name of the removed track." + }, + "remainingRootTrackCount": { + "type": "integer", + "description": "Number of root tracks remaining after removal." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "remainingRootTrackCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/tool-set-enabled-state/SKILL.md b/.agent/skills/tool-set-enabled-state/SKILL.md new file mode 100644 index 0000000..83b6de5 --- /dev/null +++ b/.agent/skills/tool-set-enabled-state/SKILL.md @@ -0,0 +1,172 @@ +--- +name: tool-set-enabled-state +description: Enable or disable MCP tools by name in batch. Persists the change via `UnityMcpPluginEditor.Instance.Save()` only when at least one tool actually flipped. Returns per-input success flags plus optional operation logs. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tool / Set Enabled State + +Enable or disable MCP tools by name. Allows controlling which tools are available for the AI agent. + +## Inputs + +- `tools` — array of `ToolToggleInput { Name, Enabled }`. Non-empty. +- `includeLogs` (default `false`) — when true, returns per-step operation logs alongside the success map. + +## Behavior + +Each entry is resolved against the tool manager's exact-name and case-insensitive lookups. Already-correct state short-circuits as success without writing. The plugin's config is saved once at the end iff at least one tool actually changed state. + +## How to Call + +```bash +unity-mcp-cli run-tool tool-set-enabled-state --input '{ + "tools": "string_value", + "includeLogs": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tool-set-enabled-state --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tool-set-enabled-state --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `tools` | `any` | Yes | Array of tools with their desired enabled state. | +| `includeLogs` | `any` | No | Include operation logs in the result. Default: false | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "tools": { + "$ref": "#/$defs/AIGD.ToolToggleInput-1" + }, + "includeLogs": { + "$ref": "#/$defs/System.Boolean" + } + }, + "$defs": { + "AIGD.ToolToggleInput": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "description": "Name of the MCP tool to enable or disable." + }, + "Enabled": { + "type": "boolean", + "description": "Whether the tool should be enabled (true) or disabled (false)." + } + }, + "required": [ + "Enabled" + ] + }, + "AIGD.ToolToggleInput-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ToolToggleInput" + } + }, + "System.Boolean": { + "type": "boolean" + } + }, + "required": [ + "tools" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ToolToggleResult" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.Logs": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.LogEntry" + } + }, + "com.IvanMurzak.ReflectorNet.Model.LogEntry": { + "type": "object", + "properties": { + "Depth": { + "type": "integer" + }, + "Message": { + "type": "string" + }, + "Type": { + "type": "string", + "enum": [ + "Trace", + "Debug", + "Info", + "Success", + "Warning", + "Error", + "Critical" + ] + } + }, + "required": [ + "Depth", + "Type" + ] + }, + "System.Collections.Generic.Dictionary(System.String,System.Boolean)": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "AIGD.ToolToggleResult": { + "type": "object", + "properties": { + "Logs": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.Logs", + "description": "Optional operation logs. Only included when 'includeLogs' is true." + }, + "Success": { + "$ref": "#/$defs/System.Collections.Generic.Dictionary(System.String,System.Boolean)", + "description": "Result of each tool operation. Key: original input name as provided by the caller (case preserved as-is). Value: true if the enable/disable operation completed successfully, false if the name was unknown, ambiguous, or empty." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/type-get-json-schema/SKILL.md b/.agent/skills/type-get-json-schema/SKILL.md new file mode 100644 index 0000000..a8e2d30 --- /dev/null +++ b/.agent/skills/type-get-json-schema/SKILL.md @@ -0,0 +1,115 @@ +--- +name: type-get-json-schema +description: Generate a JSON Schema for a C# type name via reflection. Supports primitives, enums, arrays, generic collections, dictionaries, and complex objects. Knobs control inclusion of nested `$defs` and whether type-level / property-level descriptions are emitted. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Type / Get Json Schema + +Generates a JSON Schema for a given C# type name using reflection. Supports primitives, enums, arrays, generic collections, dictionaries, and complex objects. The type must be present in any loaded assembly. Use the full type name (e.g. 'UnityEngine.Vector3') for best results. + +## Inputs + +- `typeName` — full type name preferred (e.g. `UnityEngine.Vector3`, `System.Collections.Generic.List`). Simple names work when unambiguous. +- `descriptionMode` (default `Ignore`) — controls type-level `description`: `Include` keeps it on the target only, `IncludeRecursively` also keeps it inside `$defs`, `Ignore` strips all. +- `propertyDescriptionMode` (default `Ignore`) — controls property/field/item `description`: `Include` keeps on the target's own properties/items only, `IncludeRecursively` also keeps inside `$defs`, `Ignore` strips all. +- `includeNestedTypes` (default `false`) — when true, complex nested types are extracted into `$defs` and referenced via `$ref`. Useful for recursive or large types. +- `writeIndented` (default `false`) — pretty-print the output JSON. + +## How to Call + +```bash +unity-mcp-cli run-tool type-get-json-schema --input '{ + "typeName": "string_value", + "descriptionMode": "string_value", + "propertyDescriptionMode": "string_value", + "includeNestedTypes": false, + "writeIndented": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool type-get-json-schema --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool type-get-json-schema --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `typeName` | `string` | Yes | Full C# type name to generate the schema for. Examples: 'System.String', 'UnityEngine.Vector3', 'System.Collections.Generic.List'. Simple names like 'Vector3' are also accepted when unambiguous. | +| `descriptionMode` | `string` | No | Controls the type-level 'description' field. Include: keep on the target type only. IncludeRecursively: keep on the target type and inside $defs entries. Ignore: strip all type-level descriptions. Default: Ignore. | +| `propertyDescriptionMode` | `string` | No | Controls 'description' fields on properties, fields, and array items. Include: keep on the target type's own properties/items only. IncludeRecursively: keep on all properties/items including those inside $defs entries. Ignore: strip all property/item descriptions. Default: Ignore. | +| `includeNestedTypes` | `boolean` | No | When true, complex nested types are extracted into '$defs' and referenced via '$ref' instead of being inlined. Useful for large or recursive types. Default: false. | +| `writeIndented` | `boolean` | No | Whether to format the output JSON with indentation for readability. Default: false. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "typeName": { + "type": "string" + }, + "descriptionMode": { + "type": "string", + "enum": [ + "Include", + "IncludeRecursively", + "Ignore" + ] + }, + "propertyDescriptionMode": { + "type": "string", + "enum": [ + "Include", + "IncludeRecursively", + "Ignore" + ] + }, + "includeNestedTypes": { + "type": "boolean" + }, + "writeIndented": { + "type": "boolean" + } + }, + "required": [ + "typeName" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.agent/skills/unity-initial-setup/SKILL.md b/.agent/skills/unity-initial-setup/SKILL.md new file mode 100644 index 0000000..de5419e --- /dev/null +++ b/.agent/skills/unity-initial-setup/SKILL.md @@ -0,0 +1,126 @@ +--- +name: unity-initial-setup +description: |- + Provides an initial setup for AI Skills, `unity-mcp-cli` command line tool installation + and everything else that is helpful to set up at the start of the project. Essential packages, + and basic configurations. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# AI Game Developer — Initial Setup + +This guide walks through installing the `unity-mcp-cli` command-line tool and using it to set +up a Unity project with AI Skills and MCP integration. + +--- + +## Prerequisites + +### Install Node.js + +`unity-mcp-cli` requires **Node.js ^20.19.0 || >=22.12.0** (Node 21.x is not supported). If you don't have Node.js installed: + +Download the installer from https://nodejs.org/ and run it, or use a package manager: +``` +winget install OpenJS.NodeJS.LTS +``` + +After installation, verify both `node` and `npm` are available: +``` +node --version +npm --version +``` + +--- + +## Install `unity-mcp-cli` Globally + +Install the CLI globally so the `unity-mcp-cli` command is available system-wide: + +```bash +npm install -g unity-mcp-cli +``` + +Verify installation: +```bash +unity-mcp-cli --version +``` + + +> **Alternative**: Run any command without installing globally using `npx`: +> ```bash +> npx unity-mcp-cli --help +> ``` + +--- + +## Quick Start — Full Project Setup + +### 1. Install the Unity-MCP Plugin + +Add the plugin to an existing Unity project: +```bash +unity-mcp-cli install-plugin /path/to/unity/project +``` + +### 2. Configure MCP Tools + +Enable all tools, prompts, and resources: +```bash +unity-mcp-cli configure /path/to/unity/project \ + --enable-all-tools \ + --enable-all-prompts \ + --enable-all-resources +``` + +### 3. Set Up MCP for Your AI Agent + +Configure MCP integration for your AI agent (e.g., Claude Code, Cursor, Copilot): +```bash +unity-mcp-cli setup-mcp claude-code /path/to/unity/project +``` + +List all supported agents: +```bash +unity-mcp-cli setup-mcp --list +``` + +### 4. Generate AI Skills + +Generate skill files for your AI agent (requires Unity Editor to be running with the plugin): +```bash +unity-mcp-cli setup-skills claude-code /path/to/unity/project +``` + +### 5. Open Unity with MCP Connection + +```bash +unity-mcp-cli open /path/to/unity/project +``` + +--- + +## Common Commands Reference + +| Command | Description | +|---|---| +| `unity-mcp-cli install-plugin ` | Install Unity-MCP plugin into a project | +| `unity-mcp-cli remove-plugin ` | Remove Unity-MCP plugin from a project | +| `unity-mcp-cli configure --list` | List current MCP configuration | +| `unity-mcp-cli setup-mcp ` | Write MCP config for an AI agent | +| `unity-mcp-cli setup-skills ` | Generate skill files for an AI agent | +| `unity-mcp-cli create-project ` | Create a new Unity project | +| `unity-mcp-cli install-unity ` | Install a Unity Editor version | +| `unity-mcp-cli open ` | Open a Unity project in the Editor | +| `unity-mcp-cli run-tool ` | Execute an MCP tool via HTTP API | + +Add `--verbose` to any command for detailed diagnostic output. + +--- + +## Troubleshooting + +- **`npm` not found**: Node.js is not installed or not in your PATH. Reinstall Node.js and restart your terminal. +- **Plugin not appearing in Unity**: After `install-plugin`, open the project in Unity Editor. The package manager resolves dependencies on project open. +- **Skills generation fails**: Ensure Unity Editor is running with the MCP plugin installed and connected before running `setup-skills`. diff --git a/.agent/skills/unity-skill-create/SKILL.md b/.agent/skills/unity-skill-create/SKILL.md new file mode 100644 index 0000000..965f9fc --- /dev/null +++ b/.agent/skills/unity-skill-create/SKILL.md @@ -0,0 +1,208 @@ +--- +name: unity-skill-create +description: Create a new skill (MCP tool) for the Unity Editor by writing a C# (.cs) file that Unity compiles into the project. After compilation the new tool becomes callable through MCP. The file must be a partial class decorated with [AiToolType], each tool method must be decorated with [AiTool], the class name should match the file name, all Unity API calls must run via com.IvanMurzak.ReflectorNet.Utils.MainThread.Instance.Run(), and the method should either return a structured data model (for parseable output) or void (for side-effect-only operations). See the body of this skill for a full sample and best-practice notes. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Skill (Tool) / Create + +## Full sample + +```csharp +#nullable enable +using System; +using System.ComponentModel; +using com.IvanMurzak.McpPlugin; +using com.IvanMurzak.ReflectorNet.Utils; +using com.IvanMurzak.Unity.MCP.Editor.Utils; +using AIGD; +using UnityEditor; +using UnityEngine; + +namespace com.IvanMurzak.Unity.MCP.Editor.API +{ + [AiToolType] + public partial class Tool_Sample + { + [AiTool("sample-get", Title = "Sample / Get")] + [Description("Finds a GameObject and returns its ref data.")] + public GameObjectRef Get + ( + [Description("Name of the GameObject to find.")] + string name + ) + { + return MainThread.Instance.Run(() => + { + var go = GameObject.Find(name) + ?? throw new ArgumentException($"GameObject '{name}' not found.", nameof(name)); + + return new GameObjectRef(go); + }); + } + + [AiTool("sample-rename", Title = "Sample / Rename")] + [Description("Renames a GameObject.")] + public void Rename + ( + [Description("Current name of the GameObject.")] + string name, + [Description("New name to assign.")] + string newName + ) + { + MainThread.Instance.Run(() => + { + var go = GameObject.Find(name) + ?? throw new ArgumentException($"GameObject '{name}' not found.", nameof(name)); + + go.name = newName; + EditorUtility.SetDirty(go); + AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport); + EditorUtils.RepaintAllEditorWindows(); + }); + } + } +} +``` + +## Suggestions + +### Refresh UI after visual changes +If the skill modifies anything visually in the Unity Editor (GameObjects, components, materials, etc.), call these two lines at the end of the tool method to apply changes to the UI immediately: +```csharp +AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport); +EditorUtils.RepaintAllEditorWindows(); +``` + +### Refresh AssetDatabase after asset or script changes +If the skill creates, modifies, or deletes any asset file or .cs script on disk outside of Unity API, call this inside a `MainThread.Instance.Run()` block to ensure Unity picks up the changes: +```csharp +MainThread.Instance.Run(() => +{ + AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport); +}); +``` + +### Use processing mechanic for long-running or domain-reload operations +Some operations take time to complete and may trigger a Unity domain reload (e.g. writing a .cs script, switching play mode, running tests, adding a package). In these cases the tool must NOT block and wait — instead it must: +1. Accept a `[RequestID] string? requestId` parameter. +2. Return `ResponseCallTool.Processing("...").SetRequestID(requestId)` immediately. +3. Schedule the actual work asynchronously via `MainThread.Instance.RunAsync(async () => { await Task.Yield(); ... })`. +4. When the operation finishes, send the final result by calling: +```csharp +_ = UnityMcpPluginEditor.NotifyToolRequestCompleted(new RequestToolCompletedData +{ + RequestId = requestId, + Result = ResponseCallTool.Success("Operation completed.").SetRequestID(requestId) +}); +``` +If the operation may survive a domain reload (e.g. a .cs file was saved and Unity will recompile), use `ScriptUtils.SchedulePostCompilationNotification(requestId, filePath, operationType)` instead of calling `NotifyToolRequestCompleted` directly — it persists the pending notification to `SessionState` and sends it automatically after the domain reload completes. For package install/removal or other non-compilation domain reloads use `PackageUtils.SchedulePostDomainReloadNotification(requestId, label, action, expectedResult)` the same way. + +### Return structured data with a typed response +Prefer returning a structured data model over a plain string so the AI can parse individual fields. Data models for MCP tools MUST be declared as TOP-LEVEL types in the `AIGD` namespace - never nested inside the tool class. Place each data model in its own `.cs` file (one type per file) and use `ResponseCallValueTool` as the return type. The flat `AIGD` namespace keeps the auto-generated JSON Schema `$defs` keys short and intuitive for AI agents. +```csharp +// Tool file (Tool/MyTool.cs) - references the data model from AIGD: +using AIGD; + +namespace com.IvanMurzak.Unity.MCP.Editor.API +{ + [AiToolType] + public partial class Tool_Sample + { + public ResponseCallValueTool MyTool(...) + { + return ResponseCallValueTool.Success(new MyResult + { + Name = go.name, + InstanceID = go.GetInstanceID() + }).SetRequestID(requestId); + } + } +} + +// Data model (Tool/Data/MyResult.cs) - top-level, in AIGD namespace, NOT nested: +namespace AIGD +{ + public class MyResult + { + [Description("Name of the GameObject.")] + public string? Name { get; set; } + + [Description("Unity instance ID of the GameObject.")] + public int InstanceID { get; set; } + } +} +``` +For simpler cases that do not need async/processing, you may return the model directly (without `ResponseCallValueTool`) and Unity-MCP will wrap it automatically. The data model itself MUST still live as a top-level type in the `AIGD` namespace. + +### Validate inputs early and throw clearly +Always validate required parameters at the top of the method before any Unity API calls. Throw `ArgumentException` or `InvalidOperationException` with descriptive messages so the AI knows exactly what went wrong and can self-correct: +```csharp +if (string.IsNullOrEmpty(name)) + throw new ArgumentException("Name cannot be null or empty.", nameof(name)); +``` + +### Always use MainThread for Unity API calls +All Unity API calls (including `GameObject.Find`, `AssetDatabase`, `EditorUtility`, etc.) MUST run on the main thread. Wrap them in `MainThread.Instance.Run(() => { ... })` for synchronous operations, or `MainThread.Instance.RunAsync(async () => { ... })` when you need to await inside. + +## How to Call + +```bash +unity-mcp-cli run-system-tool unity-skill-create --input '{ + "path": "string_value", + "code": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-system-tool unity-skill-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-system-tool unity-skill-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `path` | `string` | Yes | Path for the C# (.cs) file to be created. Sample: "Assets/Skills/MySkill.cs". +CRITICAL — Assembly Definition placement: If the project uses Assembly Definition files (.asmdef), you MUST place the script inside a folder that belongs to an assembly definition which already references all required dependencies (e.g. com.IvanMurzak.McpPlugin, UnityEditor, UnityEngine). Placing the file in the wrong assembly will cause compile errors due to missing type references. Before choosing a path, inspect existing .asmdef files with the assets-find tool to identify the correct assembly folder. | +| `code` | `string` | Yes | C# code for the skill tool. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "path", + "code" + ] +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/unity-skill-generate/SKILL.md b/.agent/skills/unity-skill-generate/SKILL.md new file mode 100644 index 0000000..ebba6c9 --- /dev/null +++ b/.agent/skills/unity-skill-generate/SKILL.md @@ -0,0 +1,68 @@ +--- +name: unity-skill-generate +description: "Regenerate every `SKILL.md` from the project's currently-registered MCP tools into the configured skills folder (or a project-relative override path). Writes the YAML `description:` from `[AiSkillDescription]` and the body from `[AiSkillBody]`." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Skill (Tool) / Generate All + +Generate all skills from the existed Tools in the Unity Project. + +## Inputs + +- `path` (optional) — project-relative skills folder (e.g. `.claude/skills`). Absolute paths and `..` traversal segments are rejected. When null/empty, the editor's configured `SkillsRootFolderAbsolutePath` is used. + +## Behavior + +Creates the destination folder if missing, then invokes `McpPluginInstance.GenerateSkillFiles(...)` to emit a `SKILL.md` per registered MCP tool. The plugin's `SkillsPath` is temporarily swapped to the target folder and restored in `finally` so the on-disk configuration is unchanged after the call returns. + +## How to Call + +```bash +unity-mcp-cli run-system-tool unity-skill-generate --input '{ + "path": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-system-tool unity-skill-generate --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-system-tool unity-skill-generate --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `path` | `string` | No | Path to the skills folder. If null or empty, the default path will be used. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "path": { + "type": "string" + } + } +} +``` + +## Output + +This tool does not return structured output. + diff --git a/.agent/skills/unity-tool-list/SKILL.md b/.agent/skills/unity-tool-list/SKILL.md new file mode 100644 index 0000000..bec16e2 --- /dev/null +++ b/.agent/skills/unity-tool-list/SKILL.md @@ -0,0 +1,156 @@ +--- +name: unity-tool-list +description: List all Unity-MCP tools registered in the connected Unity Editor instance. Optional regex filter matches against tool name, description, and argument names/descriptions. Use the `includeDescription` / `includeInputs` toggles to control the response size. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tool / List + +List all Unity-MCP tools registered in the connected Unity Editor instance. Optionally filter by regex across tool names, descriptions, and arguments. + +## Inputs + +- `regexSearch` (optional) — case-insensitive regex with a 200ms execution-timeout guard. Invalid regex throws an `ArgumentException`. Matches name → description → input names → input descriptions. +- `includeDescription` (default `false`) — populate each tool's `Description` field. +- `includeInputs` (default `None`) — one of `None`, `Inputs` (names only), `InputsWithDescription` (names + descriptions). + +## Behavior + +Iterates `UnityMcpPluginEditor.Instance.Tools.GetAllTools()`, evaluates the filter (if any), and projects each surviving tool into a `ToolInfoData` honoring the verbosity toggles. + +## How to Call + +```bash +unity-mcp-cli run-tool unity-tool-list --input '{ + "regexSearch": "string_value", + "includeDescription": "string_value", + "includeInputs": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool unity-tool-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool unity-tool-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `regexSearch` | `string` | No | Regex pattern to filter tools. Matches against tool name, description, and argument names and descriptions. | +| `includeDescription` | `any` | No | Include tool descriptions in the result. Default: false | +| `includeInputs` | `any` | No | Include input arguments in the result. Default: None | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "regexSearch": { + "type": "string" + }, + "includeDescription": { + "$ref": "#/$defs/System.Boolean" + }, + "includeInputs": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tool-InputRequest" + } + }, + "$defs": { + "System.Boolean": { + "type": "boolean" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tool-InputRequest": { + "type": "string", + "enum": [ + "None", + "Inputs", + "InputsWithDescription" + ], + "description": "Specifies what to include for tool input arguments." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/AIGD.ToolInfoData-1" + } + }, + "$defs": { + "AIGD.ToolInfoData": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Tool name." + }, + "description": { + "type": "string", + "description": "Tool description." + }, + "inputs": { + "$ref": "#/$defs/AIGD.ToolInputData-1", + "description": "Tool input arguments." + } + }, + "description": "MCP tool information." + }, + "AIGD.ToolInputData-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ToolInputData", + "description": "MCP tool input argument." + } + }, + "AIGD.ToolInputData": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Argument name." + }, + "description": { + "type": "string", + "description": "Argument description." + } + }, + "description": "MCP tool input argument." + }, + "AIGD.ToolInfoData-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.ToolInfoData", + "description": "MCP tool information." + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/settings.json b/.gemini/settings.json index 7e5db44..01936a8 100644 --- a/.gemini/settings.json +++ b/.gemini/settings.json @@ -2,10 +2,10 @@ "mcpServers": { "ai-game-developer": { "headers": { - "Authorization": "Bearer agd_pk_VZq7rqUiah6ZGQlrr4BlYoqDyovYo-6KSbOZxPGOMKY" + "Authorization": "Bearer agd_pk_cb5bZndsow_BtGLM1KAQ09YN-lvfzhutTRSNKX02fs4" }, "type": "http", - "url": "https://ai-game.dev/mcp/p/8a1c8571" + "url": "https://ai-game.dev/mcp/p/06300497" } } } \ No newline at end of file diff --git a/.gemini/skills/navigation-agent-add/SKILL.md b/.gemini/skills/navigation-agent-add/SKILL.md new file mode 100644 index 0000000..11d787f --- /dev/null +++ b/.gemini/skills/navigation-agent-add/SKILL.md @@ -0,0 +1,284 @@ +--- +name: navigation-agent-add +description: Add and configure a `NavMeshAgent` (from the built-in `com.unity.modules.ai`) on a GameObject — or create a new GameObject to host it. Configure agent type, speed, acceleration, angular speed, stopping distance, and the area mask. Returns the GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshAgent + +Add a `NavMeshAgent` to a GameObject so it can pathfind across a baked NavMesh. Use 'navigation-agent-set-destination' to move it. + +## Inputs + +- `gameObjectRef` — optional GameObject to add the agent to. When omitted, a new GameObject is created. +- `name` — optional name for the new GameObject (default `NavMeshAgent`); ignored when `gameObjectRef` is given. +- `agentTypeId` — optional NavMesh agent-type id (default 0 = Humanoid). +- `speed` — optional max movement speed (default 3.5). +- `acceleration` — optional max acceleration (default 8). +- `angularSpeed` — optional max turning speed in deg/s (default 120). +- `stoppingDistance` — optional stop distance from the destination (default 0). +- `areaMask` — optional traversable-area bitmask (default -1 = all areas). + +## Behavior + +Adds (or reuses) a `NavMeshAgent`, assigns the configured properties, marks the scene dirty, repaints, and returns the GameObject reference, the agent component reference, and the instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-agent-add --input '{ + "gameObjectRef": "string_value", + "name": "string_value", + "agentTypeId": 0, + "speed": 0, + "acceleration": 0, + "angularSpeed": 0, + "stoppingDistance": 0, + "areaMask": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-agent-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-agent-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | No | Optional GameObject to add the NavMeshAgent to. When omitted, a new GameObject is created. | +| `name` | `string` | No | Name for the new GameObject (ignored when gameObjectRef is provided). | +| `agentTypeId` | `integer` | No | NavMesh agent-type id (0 = Humanoid by default). | +| `speed` | `number` | No | Maximum movement speed. | +| `acceleration` | `number` | No | Maximum acceleration. | +| `angularSpeed` | `number` | No | Maximum turning speed in degrees per second. | +| `stoppingDistance` | `number` | No | Distance from the destination at which the agent stops. | +| `areaMask` | `integer` | No | Traversable-area bitmask (-1 = all areas). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "name": { + "type": "string" + }, + "agentTypeId": { + "type": "integer" + }, + "speed": { + "type": "number" + }, + "acceleration": { + "type": "number" + }, + "angularSpeed": { + "type": "number" + }, + "stoppingDistance": { + "type": "number" + }, + "areaMask": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshAgent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the GameObject hosting the agent." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Resolved agent-type id." + }, + "speed": { + "type": "number", + "description": "Resolved speed." + }, + "acceleration": { + "type": "number", + "description": "Resolved acceleration." + }, + "stoppingDistance": { + "type": "number", + "description": "Resolved stopping distance." + }, + "areaMask": { + "type": "integer", + "description": "Resolved area mask." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "agentTypeId", + "speed", + "acceleration", + "stoppingDistance", + "areaMask", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-agent-set-destination/SKILL.md b/.gemini/skills/navigation-agent-set-destination/SKILL.md new file mode 100644 index 0000000..b3737fd --- /dev/null +++ b/.gemini/skills/navigation-agent-set-destination/SKILL.md @@ -0,0 +1,288 @@ +--- +name: navigation-agent-set-destination +description: Set the destination of a `NavMeshAgent` so it pathfinds toward a world-space point. Optionally provide a target GameObject instead of explicit coordinates. The agent must be on a baked NavMesh for a path to be computed (most relevant in play mode). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Set Agent Destination + +Set a `NavMeshAgent`'s destination. The agent computes a path across the baked NavMesh and begins moving toward the destination (path computation/movement happens in play mode; in edit mode the destination is still assigned). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `NavMeshAgent` (required). +- `destination` — the world-space destination point. Ignored when `targetRef` is provided. +- `targetRef` — optional GameObject whose position is used as the destination. + +## Behavior + +Resolves the agent, computes the destination (from `targetRef` if given, else `destination`), and — when the agent is active and placed on a NavMesh — calls `SetDestination`. Off the NavMesh (e.g. before baking, in edit mode) it reports the intended destination without mutating, so the call is always safe. Returns `accepted` plus the agent's `hasPath` / `pathPending` state. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-agent-set-destination --input '{ + "gameObjectRef": "string_value", + "destination": "string_value", + "targetRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-agent-set-destination --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-agent-set-destination --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMeshAgent component. | +| `destination` | `any` | No | World-space destination point (ignored when targetRef is provided). | +| `targetRef` | `any` | No | Optional GameObject whose position is used as the destination. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "destination": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "targetRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentSetDestinationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentSetDestinationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshAgent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "destination": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "The resolved destination point." + }, + "accepted": { + "type": "boolean", + "description": "Whether SetDestination accepted the request (false if the agent is off the NavMesh)." + }, + "isOnNavMesh": { + "type": "boolean", + "description": "Whether the agent is currently on a baked NavMesh." + }, + "hasPath": { + "type": "boolean", + "description": "Whether the agent has a computed path." + }, + "pathPending": { + "type": "boolean", + "description": "Whether a path is still being computed." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "destination", + "accepted", + "isOnNavMesh", + "hasPath", + "pathPending", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-get/SKILL.md b/.gemini/skills/navigation-get/SKILL.md new file mode 100644 index 0000000..951a8ca --- /dev/null +++ b/.gemini/skills/navigation-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: navigation-get +description: "Generic read: serialize any NavMesh `Component` (NavMeshSurface / NavMeshModifier / NavMeshModifierVolume / NavMeshLink / NavMeshAgent) on a GameObject via ReflectorNet. Pair with 'navigation-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Get Component + +Serialize any NavMesh component on a GameObject using ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one NavMesh component; otherwise the first recognized NavMesh component is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target NavMesh component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMesh component. | +| `componentRef` | `any` | No | Optional reference to a specific NavMesh component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-link-add/SKILL.md b/.gemini/skills/navigation-link-add/SKILL.md new file mode 100644 index 0000000..e4c6014 --- /dev/null +++ b/.gemini/skills/navigation-link-add/SKILL.md @@ -0,0 +1,312 @@ +--- +name: navigation-link-add +description: Add and configure a `NavMeshLink` on a GameObject. A NavMeshLink connects two points on (or off) the NavMesh — e.g. a jump-across or a doorway — so agents can traverse gaps the baked mesh does not cover. Points are local to the GameObject's transform. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshLink + +Add a `NavMeshLink` to a GameObject. The link bridges `startPoint` and `endPoint` (in the GameObject's local space), letting agents cross between otherwise-disconnected NavMesh regions. + +## Inputs + +- `gameObjectRef` — the GameObject to add the link to (required). +- `startPoint` — local-space start of the link (default 0,0,-2.5). +- `endPoint` — local-space end of the link (default 0,0,2.5). +- `width` — link width in meters (default 0). +- `bidirectional` — when `true`, the link is traversable both ways (default true). +- `costModifier` — cost override; negative means use the default cost (default -1). +- `area` — NavMesh area index of the link (default 2 = Jump). + +## Behavior + +Adds (or reuses) a `NavMeshLink`, assigns the configured fields (which auto-rebuild the link), marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-link-add --input '{ + "gameObjectRef": "string_value", + "startPoint": "string_value", + "endPoint": "string_value", + "width": 0, + "bidirectional": false, + "costModifier": 0, + "area": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-link-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-link-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshLink to. | +| `startPoint` | `any` | No | Local-space start point of the link. | +| `endPoint` | `any` | No | Local-space end point of the link. | +| `width` | `number` | No | Link width in meters. | +| `bidirectional` | `boolean` | No | If true, the link is traversable in both directions. | +| `costModifier` | `integer` | No | Cost modifier for traversing the link; negative uses the default cost. | +| `area` | `integer` | No | NavMesh area index of the link (2 = Jump by default). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "startPoint": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "endPoint": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "width": { + "type": "number" + }, + "bidirectional": { + "type": "boolean" + }, + "costModifier": { + "type": "integer" + }, + "area": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-LinkAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-LinkAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the link." + }, + "linkRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshLink component." + }, + "startPoint": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved local start point." + }, + "endPoint": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved local end point." + }, + "width": { + "type": "number", + "description": "Resolved width." + }, + "bidirectional": { + "type": "boolean", + "description": "Resolved bidirectional flag." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "startPoint", + "endPoint", + "width", + "bidirectional", + "area", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-list/SKILL.md b/.gemini/skills/navigation-list/SKILL.md new file mode 100644 index 0000000..c1ad29f --- /dev/null +++ b/.gemini/skills/navigation-list/SKILL.md @@ -0,0 +1,246 @@ +--- +name: navigation-list +description: List every `NavMeshSurface` and `NavMeshAgent` in the active scene with their key settings (agent type, baked-data presence for surfaces; speed, on-NavMesh state for agents). Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / List Surfaces and Agents + +Enumerate the NavMesh components in the active scene so you can inspect what is set up. + +## Inputs + +- `includeInactive` (bool, default true) — include components on inactive/disabled GameObjects. + +## Behavior + +Finds all `NavMeshSurface` and `NavMeshAgent` instances, reports each surface's agent-type id and whether it has baked NavMeshData, and each agent's agent-type id, speed, and whether it is currently on a NavMesh. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include components on inactive/disabled GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the surface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "name": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Agent-type id this surface bakes for." + }, + "hasNavMeshData": { + "type": "boolean", + "description": "Whether the surface has baked NavMeshData." + } + }, + "required": [ + "agentTypeId", + "hasNavMeshData" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the agent GameObject." + }, + "agentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshAgent component." + }, + "name": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Agent-type id of the agent." + }, + "speed": { + "type": "number", + "description": "Movement speed of the agent." + }, + "isOnNavMesh": { + "type": "boolean", + "description": "Whether the agent is currently on a baked NavMesh." + } + }, + "required": [ + "agentTypeId", + "speed", + "isOnNavMesh" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationListResponse": { + "type": "object", + "properties": { + "surfaceCount": { + "type": "integer", + "description": "Number of NavMeshSurfaces found." + }, + "agentCount": { + "type": "integer", + "description": "Number of NavMeshAgents found." + }, + "surfaces": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceListItem-1", + "description": "The NavMeshSurfaces in the active scene." + }, + "agents": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-AgentListItem-1", + "description": "The NavMeshAgents in the active scene." + } + }, + "required": [ + "surfaceCount", + "agentCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-modifier-add/SKILL.md b/.gemini/skills/navigation-modifier-add/SKILL.md new file mode 100644 index 0000000..c8be997 --- /dev/null +++ b/.gemini/skills/navigation-modifier-add/SKILL.md @@ -0,0 +1,255 @@ +--- +name: navigation-modifier-add +description: Add and configure a `NavMeshModifier` on a GameObject. A NavMeshModifier overrides how that object (and optionally its children) is treated during baking — its NavMesh area, whether it is ignored, and link generation. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshModifier + +Add a `NavMeshModifier` to a GameObject so its geometry is baked with overridden parameters. + +## Inputs + +- `gameObjectRef` — the GameObject to add the modifier to (required). +- `overrideArea` — when `true`, the object's NavMesh area is overridden with `area`. +- `area` — the NavMesh area index to assign when `overrideArea` is true (default 0 = Walkable). +- `ignoreFromBuild` — when `true`, the object is excluded from the bake entirely. +- `applyToChildren` — when `true`, the override also applies to child objects. + +## Behavior + +Adds (or reuses) a `NavMeshModifier`, assigns the configured flags, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modifier-add --input '{ + "gameObjectRef": "string_value", + "overrideArea": false, + "area": 0, + "ignoreFromBuild": false, + "applyToChildren": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modifier-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modifier-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshModifier to. | +| `overrideArea` | `boolean` | No | If true, override the NavMesh area of this object with 'area'. | +| `area` | `integer` | No | NavMesh area index to assign when overrideArea is true (0 = Walkable). | +| `ignoreFromBuild` | `boolean` | No | If true, exclude this object from the NavMesh bake. | +| `applyToChildren` | `boolean` | No | If true, apply the override to child objects as well. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "overrideArea": { + "type": "boolean" + }, + "area": { + "type": "integer" + }, + "ignoreFromBuild": { + "type": "boolean" + }, + "applyToChildren": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the modifier." + }, + "modifierRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshModifier component." + }, + "overrideArea": { + "type": "boolean", + "description": "Resolved overrideArea flag." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "ignoreFromBuild": { + "type": "boolean", + "description": "Resolved ignoreFromBuild flag." + }, + "applyToChildren": { + "type": "boolean", + "description": "Resolved applyToChildren flag." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "overrideArea", + "area", + "ignoreFromBuild", + "applyToChildren", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-modifier-volume-add/SKILL.md b/.gemini/skills/navigation-modifier-volume-add/SKILL.md new file mode 100644 index 0000000..339c48d --- /dev/null +++ b/.gemini/skills/navigation-modifier-volume-add/SKILL.md @@ -0,0 +1,284 @@ +--- +name: navigation-modifier-volume-add +description: Add and configure a `NavMeshModifierVolume` on a GameObject. A modifier volume marks a box-shaped region of space so that any NavMesh baked inside it is assigned a specific area (e.g. a non-walkable or higher-cost zone). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshModifierVolume + +Add a `NavMeshModifierVolume` to a GameObject. Unlike a NavMeshModifier (which is tied to geometry), a volume affects whatever NavMesh is generated inside its box region. + +## Inputs + +- `gameObjectRef` — the GameObject to add the volume to (required). +- `size` — the box size of the volume (default 4,4,4). +- `center` — the box center offset (default 0,0,0). +- `area` — the NavMesh area index assigned inside the volume (default 0 = Walkable). + +## Behavior + +Adds (or reuses) a `NavMeshModifierVolume`, assigns size / center / area, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modifier-volume-add --input '{ + "gameObjectRef": "string_value", + "size": "string_value", + "center": "string_value", + "area": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modifier-volume-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modifier-volume-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject to add the NavMeshModifierVolume to. | +| `size` | `any` | No | Box size of the volume. | +| `center` | `any` | No | Box center offset of the volume. | +| `area` | `integer` | No | NavMesh area index assigned inside the volume (0 = Walkable). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "area": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierVolumeAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-ModifierVolumeAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the volume." + }, + "volumeRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshModifierVolume component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved box size." + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved box center." + }, + "area": { + "type": "integer", + "description": "Resolved area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "size", + "center", + "area", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-modify/SKILL.md b/.gemini/skills/navigation-modify/SKILL.md new file mode 100644 index 0000000..e1f58ab --- /dev/null +++ b/.gemini/skills/navigation-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: navigation-modify +description: "Generic write: apply a `SerializedMember` diff to any NavMesh `Component` on a GameObject via ReflectorNet `TryModify`. Use 'navigation-get' first to inspect the structure so the diff is targeted. Remember: fields go through the `fields` channel, properties through `props`." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Modify Component + +Modify any NavMesh component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Include only the members you want to change. C# fields must be supplied through the `fields` channel and properties through `props` (no cross-fallback). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one NavMesh component; otherwise the first recognized NavMesh component is used. + +## Behavior + +Finds the target NavMesh component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMesh component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific NavMesh component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-NavigationModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-set-bake-settings/SKILL.md b/.gemini/skills/navigation-set-bake-settings/SKILL.md new file mode 100644 index 0000000..5e5d552 --- /dev/null +++ b/.gemini/skills/navigation-set-bake-settings/SKILL.md @@ -0,0 +1,249 @@ +--- +name: navigation-set-bake-settings +description: Tune NavMesh bake settings. Agent radius / height / max-slope / step-height belong to a NavMesh agent type (in project NavMesh settings) and apply to every surface baking for that type. The voxel size is a per-surface override; pass `gameObjectRef` (a NavMeshSurface) with `voxelSize` to set it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Set Bake Settings + +Configure the parameters that control how a NavMesh is voxelized and baked. + +Agent radius / height / max-slope / step-height are stored on the **agent type** (id `agentTypeId`, default 0 = Humanoid) in the project's NavMesh settings, so they affect all surfaces baking for that type. The **voxel size** is a per-`NavMeshSurface` override. + +## Inputs + +- `agentTypeId` — the NavMesh agent type to edit (default 0 = Humanoid). +- `agentRadius` — optional agent radius (meters). +- `agentHeight` — optional agent height (meters). +- `maxSlope` — optional maximum walkable slope (degrees, 0–60). +- `stepHeight` — optional maximum step / climb height (meters). +- `gameObjectRef` — optional NavMeshSurface GameObject whose voxel-size override to set. +- `voxelSize` — optional voxel size for that surface (only applied when `gameObjectRef` is provided; sets `overrideVoxelSize = true`). + +## Behavior + +Edits the agent type's bake settings via the `NavMeshProjectSettings` serialized object (only the provided values change), and optionally enables and sets the surface voxel-size override. Marks dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-set-bake-settings --input '{ + "agentTypeId": 0, + "agentRadius": "string_value", + "agentHeight": "string_value", + "maxSlope": "string_value", + "stepHeight": "string_value", + "gameObjectRef": "string_value", + "voxelSize": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-set-bake-settings --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-set-bake-settings --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `agentTypeId` | `integer` | No | NavMesh agent-type id to edit (0 = Humanoid by default). | +| `agentRadius` | `any` | No | Agent radius in meters. | +| `agentHeight` | `any` | No | Agent height in meters. | +| `maxSlope` | `any` | No | Maximum walkable slope in degrees (0-60). | +| `stepHeight` | `any` | No | Maximum step / climb height in meters. | +| `gameObjectRef` | `any` | No | Optional NavMeshSurface GameObject whose voxel-size override to set. | +| `voxelSize` | `any` | No | Voxel size for the surface (applied only when gameObjectRef is provided). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "agentTypeId": { + "type": "integer" + }, + "agentRadius": { + "$ref": "#/$defs/System.Single" + }, + "agentHeight": { + "$ref": "#/$defs/System.Single" + }, + "maxSlope": { + "$ref": "#/$defs/System.Single" + }, + "stepHeight": { + "$ref": "#/$defs/System.Single" + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "voxelSize": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "System.Single": { + "type": "number" + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SetBakeSettingsResponse" + } + }, + "$defs": { + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SetBakeSettingsResponse": { + "type": "object", + "properties": { + "agentTypeId": { + "type": "integer", + "description": "The edited agent-type id." + }, + "agentSettingsApplied": { + "type": "boolean", + "description": "Whether agent-type bake settings were applied." + }, + "agentRadius": { + "type": "number", + "description": "Resolved agent radius after the edit." + }, + "agentHeight": { + "type": "number", + "description": "Resolved agent height after the edit." + }, + "maxSlope": { + "type": "number", + "description": "Resolved maximum slope after the edit." + }, + "stepHeight": { + "type": "number", + "description": "Resolved step / climb height after the edit." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the surface whose voxel size was set, if any." + }, + "voxelSizeApplied": { + "type": "boolean", + "description": "Whether the surface voxel size override was applied." + }, + "voxelSize": { + "type": "number", + "description": "Resolved voxel size for the surface, if set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "agentTypeId", + "agentSettingsApplied", + "agentRadius", + "agentHeight", + "maxSlope", + "stepHeight", + "voxelSizeApplied", + "voxelSize", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-surface-add/SKILL.md b/.gemini/skills/navigation-surface-add/SKILL.md new file mode 100644 index 0000000..0723689 --- /dev/null +++ b/.gemini/skills/navigation-surface-add/SKILL.md @@ -0,0 +1,294 @@ +--- +name: navigation-surface-add +description: Add and configure a `NavMeshSurface` component (from `com.unity.ai.navigation`) on a GameObject — or create a new GameObject to host it. Configure agent type, geometry-collection mode, layer mask, default area, and the box volume (size/center). Returns the GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Add NavMeshSurface + +Add a `NavMeshSurface` to a GameObject. A NavMeshSurface defines a region of the scene that is baked into a runtime NavMesh that agents can traverse. Use 'navigation-set-bake-settings' to tune the agent radius/height/slope/step and voxel size, then 'navigation-surface-bake' to bake. + +## Inputs + +- `gameObjectRef` — optional GameObject to add the surface to. When omitted, a new GameObject is created. +- `name` — optional name for the new GameObject (default `NavMesh Surface`); ignored when `gameObjectRef` is given. +- `agentTypeId` — optional NavMesh agent-type id this surface bakes for (default 0 = Humanoid). +- `collectObjects` — optional geometry collection mode: `0` All, `1` Volume, `2` Children (default 0 All). +- `defaultArea` — optional default NavMesh area index applied to collected geometry (default 0 = Walkable). +- `layerMask` — optional include-layers bitmask for geometry collection (default -1 = Everything). +- `size` — optional box volume size (only used when `collectObjects` = Volume). +- `center` — optional box volume center offset. + +## Behavior + +Adds (or reuses) a `NavMeshSurface`, assigns the configured properties, marks the scene dirty, repaints, and returns the GameObject reference, the surface component reference, and the instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-surface-add --input '{ + "gameObjectRef": "string_value", + "name": "string_value", + "agentTypeId": 0, + "collectObjects": 0, + "defaultArea": 0, + "layerMask": 0, + "size": "string_value", + "center": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-surface-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-surface-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | No | Optional GameObject to add the NavMeshSurface to. When omitted, a new GameObject is created. | +| `name` | `string` | No | Name for the new GameObject (ignored when gameObjectRef is provided). | +| `agentTypeId` | `integer` | No | NavMesh agent-type id this surface bakes for (0 = Humanoid by default). | +| `collectObjects` | `integer` | No | Geometry collection mode: 0 = All, 1 = Volume, 2 = Children. | +| `defaultArea` | `integer` | No | Default NavMesh area index applied to collected geometry (0 = Walkable). | +| `layerMask` | `integer` | No | Include-layers bitmask for geometry collection (-1 = Everything). | +| `size` | `any` | No | Box volume size (used only when collectObjects = Volume). | +| `center` | `any` | No | Box volume center offset. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "name": { + "type": "string" + }, + "agentTypeId": { + "type": "integer" + }, + "collectObjects": { + "type": "integer" + }, + "defaultArea": { + "type": "integer" + }, + "layerMask": { + "type": "integer" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "center": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceAddResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceAddResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshSurface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the GameObject hosting the surface." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the GameObject." + }, + "agentTypeId": { + "type": "integer", + "description": "Resolved agent-type id." + }, + "collectObjects": { + "type": "integer", + "description": "Resolved geometry collection mode." + }, + "defaultArea": { + "type": "integer", + "description": "Resolved default area index." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "agentTypeId", + "collectObjects", + "defaultArea", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/navigation-surface-bake/SKILL.md b/.gemini/skills/navigation-surface-bake/SKILL.md new file mode 100644 index 0000000..286a40f --- /dev/null +++ b/.gemini/skills/navigation-surface-bake/SKILL.md @@ -0,0 +1,227 @@ +--- +name: navigation-surface-bake +description: Bake (build) the NavMesh for a `NavMeshSurface`, or clear its existing baked data. Pass `clear = true` to remove the baked NavMeshData instead of building it. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Navigation / Bake or Clear NavMeshSurface + +Build or clear the runtime NavMesh for a `NavMeshSurface`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `NavMeshSurface` (required). +- `clear` — when `true`, removes the surface's baked NavMeshData (`RemoveData`) instead of baking. Default `false` (bake via `BuildNavMesh`). + +## Behavior + +When baking, collects the surface's geometry sources and builds the NavMeshData, then marks the surface dirty so the result is saved. When clearing, removes the active NavMeshData from the surface. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool navigation-surface-bake --input '{ + "gameObjectRef": "string_value", + "clear": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool navigation-surface-bake --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool navigation-surface-bake --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the NavMeshSurface component. | +| `clear` | `boolean` | No | If true, clears the baked NavMeshData instead of baking it. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clear": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceBakeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Navigation-SurfaceBakeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the NavMeshSurface GameObject." + }, + "surfaceRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the NavMeshSurface component." + }, + "cleared": { + "type": "boolean", + "description": "Whether the surface was cleared (true) or baked (false)." + }, + "hasNavMeshData": { + "type": "boolean", + "description": "Whether the surface has baked NavMeshData after the operation." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cleared", + "hasNavMeshData", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/particle-system-get/SKILL.md b/.gemini/skills/particle-system-get/SKILL.md new file mode 100644 index 0000000..15ca66e --- /dev/null +++ b/.gemini/skills/particle-system-get/SKILL.md @@ -0,0 +1,542 @@ +--- +name: particle-system-get +description: Inspect a `UnityEngine.ParticleSystem` component on a GameObject — runtime state (playing/paused/emitting/stopped, particle count, time) plus opt-in serialized data for any of the ~24 particle modules (Main, Emission, Shape, Velocity, Noise, Collision, Trails, Renderer, etc.). Pair with 'particle-system-modify' to write changes back. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# ParticleSystem / Get + +Inspect a `UnityEngine.ParticleSystem` component on a GameObject. Returns runtime state (`isPlaying`, `isPaused`, `isEmitting`, `isStopped`, `particleCount`, `time`) plus opt-in serialized data for any of the particle modules. Use 'particle-system-modify' afterwards to write changes back. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required). +- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than one; otherwise the first `ParticleSystem` found is used. +- `includeMain`, `includeEmission`, `includeShape`, `includeVelocityOverLifetime`, `includeLimitVelocityOverLifetime`, `includeInheritVelocity`, `includeLifetimeByEmitterSpeed`, `includeForceOverLifetime`, `includeColorOverLifetime`, `includeColorBySpeed`, `includeSizeOverLifetime`, `includeSizeBySpeed`, `includeRotationOverLifetime`, `includeRotationBySpeed`, `includeExternalForces`, `includeNoise`, `includeCollision`, `includeTrigger`, `includeSubEmitters`, `includeTextureSheetAnimation`, `includeLights`, `includeTrails`, `includeCustomData`, `includeRenderer` — per-module toggles. `includeMain` defaults to `true`; everything else defaults to `false`. +- `includeAll` — when `true`, overrides every per-module flag and emits all modules. +- `deepSerialization` — when `true`, recurses through nested objects via ReflectorNet; otherwise only top-level members are serialized (cheaper, smaller payload). + +## Behavior + +Only the modules whose include-flags resolve to `true` are serialized — this keeps responses small when you only need one or two modules. `includeRenderer` reads the sibling `UnityEngine.ParticleSystemRenderer` component on the same GameObject and is skipped silently when no renderer is present. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool particle-system-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "includeMain": false, + "includeEmission": false, + "includeShape": false, + "includeVelocityOverLifetime": false, + "includeLimitVelocityOverLifetime": false, + "includeInheritVelocity": false, + "includeLifetimeByEmitterSpeed": false, + "includeForceOverLifetime": false, + "includeColorOverLifetime": false, + "includeColorBySpeed": false, + "includeSizeOverLifetime": false, + "includeSizeBySpeed": false, + "includeRotationOverLifetime": false, + "includeRotationBySpeed": false, + "includeExternalForces": false, + "includeNoise": false, + "includeCollision": false, + "includeTrigger": false, + "includeSubEmitters": false, + "includeTextureSheetAnimation": false, + "includeLights": false, + "includeTrails": false, + "includeCustomData": false, + "includeRenderer": false, + "includeAll": false, + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool particle-system-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool particle-system-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the ParticleSystem component. | +| `componentRef` | `any` | No | Optional reference to a specific ParticleSystem component if the GameObject has multiple. If not provided, uses the first ParticleSystem found. | +| `includeMain` | `boolean` | No | Include Main module data (duration, looping, prewarm, startDelay, startLifetime, startSpeed, startSize, startRotation, startColor, gravityModifier, simulationSpace, scalingMode, playOnAwake, maxParticles, etc.). | +| `includeEmission` | `boolean` | No | Include Emission module data (rateOverTime, rateOverDistance, bursts). | +| `includeShape` | `boolean` | No | Include Shape module data (shapeType, radius, angle, arc, position, rotation, scale, mesh, texture, etc.). | +| `includeVelocityOverLifetime` | `boolean` | No | Include Velocity over Lifetime module data (x, y, z, space, orbital, radial, speedModifier). | +| `includeLimitVelocityOverLifetime` | `boolean` | No | Include Limit Velocity over Lifetime module data (limit, dampen, separateAxes, drag). | +| `includeInheritVelocity` | `boolean` | No | Include Inherit Velocity module data (mode, curve). | +| `includeLifetimeByEmitterSpeed` | `boolean` | No | Include Lifetime by Emitter Speed module data (curve, range). | +| `includeForceOverLifetime` | `boolean` | No | Include Force over Lifetime module data (x, y, z, space, randomized). | +| `includeColorOverLifetime` | `boolean` | No | Include Color over Lifetime module data (color gradient). | +| `includeColorBySpeed` | `boolean` | No | Include Color by Speed module data (color, range). | +| `includeSizeOverLifetime` | `boolean` | No | Include Size over Lifetime module data (size curve, separateAxes). | +| `includeSizeBySpeed` | `boolean` | No | Include Size by Speed module data (size, range). | +| `includeRotationOverLifetime` | `boolean` | No | Include Rotation over Lifetime module data (angular velocity, separateAxes). | +| `includeRotationBySpeed` | `boolean` | No | Include Rotation by Speed module data (angular velocity, range). | +| `includeExternalForces` | `boolean` | No | Include External Forces module data (multiplier, influenceFilter). | +| `includeNoise` | `boolean` | No | Include Noise module data (strength, frequency, scrollSpeed, damping, octaves, quality, remap). | +| `includeCollision` | `boolean` | No | Include Collision module data (type, mode, planes, dampen, bounce, lifetimeLoss). | +| `includeTrigger` | `boolean` | No | Include Trigger module data (inside, outside, enter, exit actions). | +| `includeSubEmitters` | `boolean` | No | Include Sub Emitters module data (birth, collision, death, trigger, manual emitters). | +| `includeTextureSheetAnimation` | `boolean` | No | Include Texture Sheet Animation module data (mode, tiles, animation, frameOverTime). | +| `includeLights` | `boolean` | No | Include Lights module data (ratio, light, color, range, intensity). | +| `includeTrails` | `boolean` | No | Include Trails module data (mode, ratio, lifetime, width, color). | +| `includeCustomData` | `boolean` | No | Include Custom Data module data (modes, vectors, colors). | +| `includeRenderer` | `boolean` | No | Include Renderer module data (renderMode, material, sortMode, alignment, shadows). | +| `includeAll` | `boolean` | No | Include ALL modules data. Overrides individual flags. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including all nested objects. Otherwise, only serializes top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "includeMain": { + "type": "boolean" + }, + "includeEmission": { + "type": "boolean" + }, + "includeShape": { + "type": "boolean" + }, + "includeVelocityOverLifetime": { + "type": "boolean" + }, + "includeLimitVelocityOverLifetime": { + "type": "boolean" + }, + "includeInheritVelocity": { + "type": "boolean" + }, + "includeLifetimeByEmitterSpeed": { + "type": "boolean" + }, + "includeForceOverLifetime": { + "type": "boolean" + }, + "includeColorOverLifetime": { + "type": "boolean" + }, + "includeColorBySpeed": { + "type": "boolean" + }, + "includeSizeOverLifetime": { + "type": "boolean" + }, + "includeSizeBySpeed": { + "type": "boolean" + }, + "includeRotationOverLifetime": { + "type": "boolean" + }, + "includeRotationBySpeed": { + "type": "boolean" + }, + "includeExternalForces": { + "type": "boolean" + }, + "includeNoise": { + "type": "boolean" + }, + "includeCollision": { + "type": "boolean" + }, + "includeTrigger": { + "type": "boolean" + }, + "includeSubEmitters": { + "type": "boolean" + }, + "includeTextureSheetAnimation": { + "type": "boolean" + }, + "includeLights": { + "type": "boolean" + }, + "includeTrails": { + "type": "boolean" + }, + "includeCustomData": { + "type": "boolean" + }, + "includeRenderer": { + "type": "boolean" + }, + "includeAll": { + "type": "boolean" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.GetParticleSystemResponse", + "description": "Response containing ParticleSystem data with requested modules." + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.GetParticleSystemResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the ParticleSystem component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the ParticleSystem component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the ParticleSystem component in the GameObject's component list." + }, + "isPlaying": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently playing." + }, + "isPaused": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently paused." + }, + "isEmitting": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently emitting." + }, + "isStopped": { + "type": "boolean", + "description": "Whether the ParticleSystem is currently stopped." + }, + "particleCount": { + "type": "integer", + "description": "Current particle count." + }, + "time": { + "type": "number", + "description": "Current simulation time." + }, + "main": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Main module data." + }, + "emission": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Emission module data." + }, + "shape": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Shape module data." + }, + "velocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Velocity over Lifetime module data." + }, + "limitVelocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Limit Velocity over Lifetime module data." + }, + "inheritVelocity": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Inherit Velocity module data." + }, + "lifetimeByEmitterSpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Lifetime by Emitter Speed module data." + }, + "forceOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Force over Lifetime module data." + }, + "colorOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Color over Lifetime module data." + }, + "colorBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Color by Speed module data." + }, + "sizeOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Size over Lifetime module data." + }, + "sizeBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Size by Speed module data." + }, + "rotationOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Rotation over Lifetime module data." + }, + "rotationBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Rotation by Speed module data." + }, + "externalForces": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "External Forces module data." + }, + "noise": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Noise module data." + }, + "collision": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Collision module data." + }, + "trigger": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Trigger module data." + }, + "subEmitters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Sub Emitters module data." + }, + "textureSheetAnimation": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Texture Sheet Animation module data." + }, + "lights": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Lights module data." + }, + "trails": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Trails module data." + }, + "customData": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Custom Data module data." + }, + "renderer": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Renderer module data." + } + }, + "required": [ + "componentIndex", + "isPlaying", + "isPaused", + "isEmitting", + "isStopped", + "particleCount", + "time" + ], + "description": "Response containing ParticleSystem data with requested modules." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/particle-system-modify/SKILL.md b/.gemini/skills/particle-system-modify/SKILL.md new file mode 100644 index 0000000..3185158 --- /dev/null +++ b/.gemini/skills/particle-system-modify/SKILL.md @@ -0,0 +1,419 @@ +--- +name: particle-system-modify +description: Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass `SerializedMember` payloads only for the modules you want to change; everything else is left alone. Use 'particle-system-get' first to inspect the current structure. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# ParticleSystem / Modify + +Modify a `UnityEngine.ParticleSystem` component on a GameObject. Pass `SerializedMember` payloads only for the modules you want to change; omitted modules are left untouched. Use 'particle-system-get' first to inspect the current structure so the diff is targeted. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ParticleSystem` component (required). +- `componentRef` — optional. Resolves a specific `ParticleSystem` when the GameObject has more than one; otherwise the first `ParticleSystem` found is used. +- `main`, `emission`, `shape`, `velocityOverLifetime`, `limitVelocityOverLifetime`, `inheritVelocity`, `lifetimeByEmitterSpeed`, `forceOverLifetime`, `colorOverLifetime`, `colorBySpeed`, `sizeOverLifetime`, `sizeBySpeed`, `rotationOverLifetime`, `rotationBySpeed`, `externalForces`, `noise`, `collision`, `trigger`, `subEmitters`, `textureSheetAnimation`, `lights`, `trails`, `customData`, `renderer` — optional `SerializedMember` payloads per module. Include only the properties you want to change. + +## Behavior + +Each non-null module is applied via `Reflector.TryModify` and logged with a `[ModuleName]` prefix in the response's `logs` array. The `renderer` payload targets the sibling `UnityEngine.ParticleSystemRenderer` component on the same GameObject; if absent, the call logs the miss instead of throwing. When at least one module was modified, the GameObject and the `ParticleSystem` are marked dirty so the change persists. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool particle-system-modify --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "main": "string_value", + "emission": "string_value", + "shape": "string_value", + "velocityOverLifetime": "string_value", + "limitVelocityOverLifetime": "string_value", + "inheritVelocity": "string_value", + "lifetimeByEmitterSpeed": "string_value", + "forceOverLifetime": "string_value", + "colorOverLifetime": "string_value", + "colorBySpeed": "string_value", + "sizeOverLifetime": "string_value", + "sizeBySpeed": "string_value", + "rotationOverLifetime": "string_value", + "rotationBySpeed": "string_value", + "externalForces": "string_value", + "noise": "string_value", + "collision": "string_value", + "trigger": "string_value", + "subEmitters": "string_value", + "textureSheetAnimation": "string_value", + "lights": "string_value", + "trails": "string_value", + "customData": "string_value", + "renderer": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool particle-system-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool particle-system-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the ParticleSystem component. | +| `componentRef` | `any` | No | Optional reference to a specific ParticleSystem component if the GameObject has multiple. If not provided, uses the first ParticleSystem found. | +| `main` | `any` | No | Main module data to apply. Only include properties you want to change. | +| `emission` | `any` | No | Emission module data to apply. Only include properties you want to change. | +| `shape` | `any` | No | Shape module data to apply. Only include properties you want to change. | +| `velocityOverLifetime` | `any` | No | Velocity over Lifetime module data to apply. Only include properties you want to change. | +| `limitVelocityOverLifetime` | `any` | No | Limit Velocity over Lifetime module data to apply. Only include properties you want to change. | +| `inheritVelocity` | `any` | No | Inherit Velocity module data to apply. Only include properties you want to change. | +| `lifetimeByEmitterSpeed` | `any` | No | Lifetime by Emitter Speed module data to apply. Only include properties you want to change. | +| `forceOverLifetime` | `any` | No | Force over Lifetime module data to apply. Only include properties you want to change. | +| `colorOverLifetime` | `any` | No | Color over Lifetime module data to apply. Only include properties you want to change. | +| `colorBySpeed` | `any` | No | Color by Speed module data to apply. Only include properties you want to change. | +| `sizeOverLifetime` | `any` | No | Size over Lifetime module data to apply. Only include properties you want to change. | +| `sizeBySpeed` | `any` | No | Size by Speed module data to apply. Only include properties you want to change. | +| `rotationOverLifetime` | `any` | No | Rotation over Lifetime module data to apply. Only include properties you want to change. | +| `rotationBySpeed` | `any` | No | Rotation by Speed module data to apply. Only include properties you want to change. | +| `externalForces` | `any` | No | External Forces module data to apply. Only include properties you want to change. | +| `noise` | `any` | No | Noise module data to apply. Only include properties you want to change. | +| `collision` | `any` | No | Collision module data to apply. Only include properties you want to change. | +| `trigger` | `any` | No | Trigger module data to apply. Only include properties you want to change. | +| `subEmitters` | `any` | No | Sub Emitters module data to apply. Only include properties you want to change. | +| `textureSheetAnimation` | `any` | No | Texture Sheet Animation module data to apply. Only include properties you want to change. | +| `lights` | `any` | No | Lights module data to apply. Only include properties you want to change. | +| `trails` | `any` | No | Trails module data to apply. Only include properties you want to change. | +| `customData` | `any` | No | Custom Data module data to apply. Only include properties you want to change. | +| `renderer` | `any` | No | Renderer module data to apply. Only include properties you want to change. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "main": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "emission": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "shape": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "velocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "limitVelocityOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "inheritVelocity": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "lifetimeByEmitterSpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "forceOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "colorOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "colorBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "sizeOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "sizeBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "rotationOverLifetime": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "rotationBySpeed": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "externalForces": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "noise": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "collision": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trigger": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "subEmitters": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "textureSheetAnimation": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "lights": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trails": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "customData": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "renderer": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.ModifyParticleSystemResponse", + "description": "Response containing the result of modifying a ParticleSystem." + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.ModifyParticleSystemResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the ParticleSystem component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified ParticleSystem component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the ParticleSystem component in the GameObject's component list." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications made and any warnings/errors encountered." + } + }, + "required": [ + "success", + "componentIndex" + ], + "description": "Response containing the result of modifying a ParticleSystem." + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-bevel/SKILL.md b/.gemini/skills/probuilder-bevel/SKILL.md new file mode 100644 index 0000000..1af0ce0 --- /dev/null +++ b/.gemini/skills/probuilder-bevel/SKILL.md @@ -0,0 +1,185 @@ +--- +name: probuilder-bevel +description: Bevel (chamfer) selected edges of a `ProBuilderMesh`, replacing each sharp edge with an angled face. Identify edges by their `[vertexA, vertexB]` index pairs — use 'probuilder-get-mesh-info' to discover them. `amount` is clamped to (0, 1). +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Bevel ProBuilder edges + +Bevel (chamfer) selected edges of a `ProBuilderMesh`, replacing each sharp edge with an angled face for a smoother appearance. Use 'probuilder-get-mesh-info' first to discover edges by their vertex pairs. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — array of edge definitions; each edge is `[vertexA, vertexB]`. Example: `[[0,1], [2,3]]` bevels two edges. +- `amount` — bevel strength in the range (0, 1). `0.001` is barely visible, `0.999` reaches face center. Recommended `0.05`–`0.2`. Internally clamped. + +## Behavior + +Vertex indices are validated against `vertexCount`. After `BevelEdges` runs, the mesh is rebuilt (`ToMesh` → `Refresh`), the `ProBuilderMesh` and GameObject are marked dirty, and Editor windows repaint. Returns the number of edges processed, the clamped amount, and post-op face/vertex/edge counts. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-bevel --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "amount": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-bevel --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-bevel --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | Yes | Array of edge definitions. Each edge is defined by two vertex indices [vertexA, vertexB]. Example: [[0,1], [2,3]] bevels edges from vertex 0 to 1 and from vertex 2 to 3. | +| `amount` | `number` | No | Bevel amount from 0 (no bevel) to 1 (maximum bevel reaching face center). Recommended values: 0.05 to 0.2. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "amount": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + } + }, + "required": [ + "gameObjectRef", + "edges" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BevelResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BevelResponse": { + "type": "object", + "properties": { + "edgesBeveled": { + "type": "integer" + }, + "bevelAmount": { + "type": "number" + }, + "newFacesCreated": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "edgesBeveled", + "bevelAmount", + "newFacesCreated", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-bridge/SKILL.md b/.gemini/skills/probuilder-bridge/SKILL.md new file mode 100644 index 0000000..888835d --- /dev/null +++ b/.gemini/skills/probuilder-bridge/SKILL.md @@ -0,0 +1,206 @@ +--- +name: probuilder-bridge +description: Create a single new face that bridges two existing edges of a `ProBuilderMesh`. Useful for connecting separate parts of geometry or filling gaps. Pair with 'probuilder-get-mesh-info' to discover valid edges. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Bridge two edges in a ProBuilder mesh + +Create a single new face that bridges two existing edges of a `ProBuilderMesh`. Useful for connecting separate parts of geometry or filling gaps between disjoint sections. Pair with 'probuilder-get-mesh-info' to discover valid edges first. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edgeA` — first edge as `[vertexA, vertexB]`. +- `edgeB` — second edge as `[vertexA, vertexB]`. +- `allowNonManifold` — when `true`, permits the bridge to share an edge with more than two faces. Defaults to `false`. + +## Example + +`edgeA=[0,1]`, `edgeB=[4,5]` creates a quad face between the two edges. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. Returns the index of the new face, before/after face counts, and post-op vertex/edge counts. Throws when the bridge cannot be formed (e.g., edges already connected or non-manifold check blocked it). The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-bridge --input '{ + "gameObjectRef": "string_value", + "edgeA": "string_value", + "edgeB": "string_value", + "allowNonManifold": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-bridge --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-bridge --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edgeA` | `any` | Yes | First edge as [vertexA, vertexB]. | +| `edgeB` | `any` | Yes | Second edge as [vertexA, vertexB]. | +| `allowNonManifold` | `boolean` | No | If true, allows creation of non-manifold geometry (edges shared by more than 2 faces). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edgeA": { + "$ref": "#/$defs/System.Int32-1" + }, + "edgeB": { + "$ref": "#/$defs/System.Int32-1" + }, + "allowNonManifold": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "gameObjectRef", + "edgeA", + "edgeB" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BridgeResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BridgeResponse": { + "type": "object", + "properties": { + "edgeA": { + "$ref": "#/$defs/System.Int32-1" + }, + "edgeB": { + "$ref": "#/$defs/System.Int32-1" + }, + "newFaceIndex": { + "type": "integer" + }, + "allowNonManifold": { + "type": "boolean" + }, + "faceCountBefore": { + "type": "integer" + }, + "faceCountAfter": { + "type": "integer" + }, + "facesAdded": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "newFaceIndex", + "allowNonManifold", + "faceCountBefore", + "faceCountAfter", + "facesAdded", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-connect-edges/SKILL.md b/.gemini/skills/probuilder-connect-edges/SKILL.md new file mode 100644 index 0000000..2f4c213 --- /dev/null +++ b/.gemini/skills/probuilder-connect-edges/SKILL.md @@ -0,0 +1,215 @@ +--- +name: probuilder-connect-edges +description: Insert new edges connecting the midpoints of selected edges within faces of a `ProBuilderMesh` — adds edge loops and extra geometry detail. Supply either `edges` (explicit list) or `faceDirection` (semantic selection); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Connect edges in a ProBuilder mesh + +Insert new edges connecting the midpoints of selected edges within faces of a `ProBuilderMesh`. When a face has more than two edges to connect, a center vertex is added. Useful for creating new edge loops and adding geometry detail. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — explicit list of edges to connect, each as `[vertexA, vertexB]`. Use 'probuilder-get-mesh-info' to discover valid indices. +- `faceDirection` — semantic alternative: connects all edges of faces pointing this direction (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `edges` / `faceDirection` is required. + +## Examples + +- Connect opposite edges of the top face: `faceDirection="up"`. +- Connect specific edges: `edges=[[0,1], [2,3]]`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-connect-edges --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-connect-edges --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-connect-edges --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | No | Array of edge definitions. Each edge is [vertexA, vertexB]. Use ProBuilder_GetMeshInfo to get vertex indices. | +| `faceDirection` | `any` | No | Semantic face selection - connect edges of faces facing this direction. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ConnectEdgesResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ConnectEdgesResponse": { + "type": "object", + "properties": { + "selectionMethod": { + "type": "string" + }, + "edgesConnected": { + "type": "integer" + }, + "newFacesCreated": { + "type": "integer" + }, + "newEdgesCreated": { + "type": "integer" + }, + "faceCountBefore": { + "type": "integer" + }, + "faceCountAfter": { + "type": "integer" + }, + "facesAdded": { + "type": "integer" + }, + "edgeCountBefore": { + "type": "integer" + }, + "edgeCountAfter": { + "type": "integer" + }, + "edgesAdded": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + } + }, + "required": [ + "edgesConnected", + "newFacesCreated", + "newEdgesCreated", + "faceCountBefore", + "faceCountAfter", + "facesAdded", + "edgeCountBefore", + "edgeCountAfter", + "edgesAdded", + "totalVertexCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-create-poly-shape/SKILL.md b/.gemini/skills/probuilder-create-poly-shape/SKILL.md new file mode 100644 index 0000000..8e2f188 --- /dev/null +++ b/.gemini/skills/probuilder-create-poly-shape/SKILL.md @@ -0,0 +1,288 @@ +--- +name: probuilder-create-poly-shape +description: Create a 3D `ProBuilderMesh` from a 2D polygon outline (x,z points) extruded upward by `height`. Perfect for floor plans, room layouts, terrain patches, walls, platforms — any shape definable by a 2D outline. Requires ≥3 points. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Create a ProBuilder shape from polygon points + +Create a 3D `ProBuilderMesh` from a 2D polygon outline (x,z points) extruded upward by `height`. Perfect for: + +- Floor plans and room layouts. +- Custom terrain patches. +- Architectural elements (walls, platforms). +- Any shape that can be defined by a 2D outline. + +## Inputs + +- `points` — array of 2D points as `[x, z]`. Minimum 3 points; should be in clockwise or counter-clockwise order. +- `height` — extrusion height upward (Y axis). Default `1`. +- `name` — optional GameObject name. +- `parentGameObjectRef` — optional parent; root of the scene when omitted. +- `position`, `rotation` — optional `Vector3` transform values (rotation in euler degrees). +- `flipNormals` — when `true`, flip the resulting face normals so the shape points inward. +- `isLocalSpace` — when `true`, position/rotation are interpreted in the parent's local space. + +## Examples + +- Rectangle: `points=[[0,0], [4,0], [4,3], [0,3]]`, `height=2.5`. +- L-shape: `points=[[0,0], [3,0], [3,2], [1,2], [1,3], [0,3]]`, `height=3`. +- Triangle: `points=[[0,0], [2,0], [1,1.7]]`, `height=1`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-create-poly-shape --input '{ + "points": "string_value", + "height": 0, + "name": "string_value", + "parentGameObjectRef": "string_value", + "position": "string_value", + "rotation": "string_value", + "flipNormals": false, + "isLocalSpace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-create-poly-shape --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-create-poly-shape --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `points` | `any` | Yes | 2D polygon points as [x,z] coordinates. Minimum 3 points. Points should be in clockwise or counter-clockwise order. Example: [[0,0], [4,0], [4,3], [0,3]] creates a 4x3 rectangle. | +| `height` | `number` | No | Height to extrude the polygon upward. Default is 1. | +| `name` | `string` | No | Name of the new GameObject. | +| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. | +| `position` | `any` | No | Position of the shape in world or local space. | +| `rotation` | `any` | No | Rotation of the shape in euler angles (degrees). | +| `flipNormals` | `boolean` | No | If true, flip the normals so the faces point inward instead of outward. | +| `isLocalSpace` | `boolean` | No | If true, position/rotation are in local space relative to parent. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "points": { + "$ref": "#/$defs/System.Single-1-1" + }, + "height": { + "type": "number" + }, + "name": { + "type": "string" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "flipNormals": { + "type": "boolean" + }, + "isLocalSpace": { + "type": "boolean" + } + }, + "$defs": { + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "points" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreatePolyShapeResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "x": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "index", + "x", + "z" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreatePolyShapeResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "position": { + "type": "string" + }, + "rotation": { + "type": "string" + }, + "pointCount": { + "type": "integer" + }, + "height": { + "type": "number" + }, + "flipNormals": { + "type": "boolean" + }, + "boundsSize": { + "type": "string" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + }, + "inputPoints": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-PointInfo)" + } + }, + "required": [ + "instanceId", + "pointCount", + "height", + "flipNormals", + "faceCount", + "vertexCount", + "edgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-create-shape/SKILL.md b/.gemini/skills/probuilder-create-shape/SKILL.md new file mode 100644 index 0000000..0e349aa --- /dev/null +++ b/.gemini/skills/probuilder-create-shape/SKILL.md @@ -0,0 +1,246 @@ +--- +name: probuilder-create-shape +description: Create a new editable `ProBuilderMesh` GameObject in the active scene from a `ShapeType` primitive (Cube, Cylinder, Sphere, Plane, Prism, Cone, Stair, etc.). Optionally set name, parent, transform, size, and world/local space. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Create a ProBuilder shape + +Create a new editable `ProBuilderMesh` GameObject in the active scene. ProBuilder shapes are editable 3D meshes that can be further modified with the rest of the ProBuilder tools (extrude, bevel, subdivide, etc.). + +## Inputs + +- `shapeType` — `ShapeType` enum (Cube, Cylinder, Sphere, Plane, Prism, Cone, Stair, Door, Pipe, Arch, Sprite, Torus, etc.). +- `name` — optional GameObject name. +- `parentGameObjectRef` — optional parent; root of the scene when omitted. +- `position`, `rotation`, `scale` — optional `Vector3` transform values. Rotation is euler degrees. Defaults: zero / zero / one. +- `size` — `Vector3` width/height/depth of the generated shape. Default `(1, 1, 1)`. +- `isLocalSpace` — when `true`, position/rotation/scale are interpreted in the parent's local space; otherwise world space. + +## Behavior + +Uses `ShapeGenerator.CreateShape` with `PivotLocation.Center`, applies the transform values, rebuilds the mesh, marks dirty, and repaints the Editor. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-create-shape --input '{ + "shapeType": "string_value", + "name": "string_value", + "parentGameObjectRef": "string_value", + "position": "string_value", + "rotation": "string_value", + "scale": "string_value", + "size": "string_value", + "isLocalSpace": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-create-shape --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-create-shape --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `shapeType` | `string` | Yes | The type of shape to create. | +| `name` | `string` | No | Name of the new GameObject. | +| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the shape will be created at the root of the scene. | +| `position` | `any` | No | Position of the shape in world or local space. | +| `rotation` | `any` | No | Rotation of the shape in euler angles (degrees). | +| `scale` | `any` | No | Scale of the shape. | +| `size` | `any` | No | Size of the shape (width, height, depth). Default is (1, 1, 1). | +| `isLocalSpace` | `boolean` | No | If true, position/rotation/scale are in local space relative to parent. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "shapeType": { + "type": "string", + "enum": [ + "Cube", + "Stair", + "CurvedStair", + "Prism", + "Cylinder", + "Plane", + "Door", + "Pipe", + "Cone", + "Sprite", + "Arch", + "Sphere", + "Torus" + ] + }, + "name": { + "type": "string" + }, + "parentGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "isLocalSpace": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "shapeType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreateShapeResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-CreateShapeResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "shapeType": { + "type": "string" + }, + "position": { + "type": "string" + }, + "rotation": { + "type": "string" + }, + "scale": { + "type": "string" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + } + }, + "required": [ + "instanceId", + "faceCount", + "vertexCount", + "edgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-delete-faces/SKILL.md b/.gemini/skills/probuilder-delete-faces/SKILL.md new file mode 100644 index 0000000..2f289c9 --- /dev/null +++ b/.gemini/skills/probuilder-delete-faces/SKILL.md @@ -0,0 +1,206 @@ +--- +name: probuilder-delete-faces +description: Delete selected faces from a `ProBuilderMesh`, creating holes or removing geometry. Supply either `faceIndices` (explicit list) or `faceDirection` (semantic selection); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Delete ProBuilder faces + +Delete selected faces from a `ProBuilderMesh`, creating holes or removing geometry entirely. Faces can be selected explicitly by index or semantically by direction. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — explicit array of face indices to delete. Use 'probuilder-get-mesh-info' to discover valid indices. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. + +## Examples + +- Delete the bottom face: `faceDirection="down"`. +- Delete specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), the `ProBuilderMesh` and GameObject are marked dirty, and Editor windows repaint. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-delete-faces --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-delete-faces --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-delete-faces --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to delete. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-DeleteFacesResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-DeleteFacesResponse": { + "type": "object", + "properties": { + "deletedFaceCount": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "deletedFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "facesRemoved": { + "type": "integer" + }, + "verticesRemoved": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "deletedFaceCount", + "facesRemoved", + "verticesRemoved", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-extrude/SKILL.md b/.gemini/skills/probuilder-extrude/SKILL.md new file mode 100644 index 0000000..c12f404 --- /dev/null +++ b/.gemini/skills/probuilder-extrude/SKILL.md @@ -0,0 +1,229 @@ +--- +name: probuilder-extrude +description: Extrude selected faces of a `ProBuilderMesh` along their normals, creating new geometry. Supply either `faceIndices` (explicit) or `faceDirection` (semantic); exactly one is required. Positive `distance` extrudes outward, negative inward. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Extrude ProBuilder faces + +Extrude selected faces of a `ProBuilderMesh` along their normals, creating new geometry by pushing faces outward (positive distance) or inward (negative distance). Faces can be selected explicitly by index or semantically by direction. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — explicit array of face indices to extrude. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. +- `distance` — extrusion distance. Positive = outward, negative = inward. Default `0.5`. +- `extrudeMethod` — `IndividualFaces` (each face extrudes independently), `FaceNormal` (faces extrude as a group along the averaged normal — the default), or `VertexNormal` (vertices move along their normals). + +## Examples + +- Extrude the top face up by 1 unit: `faceDirection="up"`, `distance=1`. +- Extrude specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-extrude --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value", + "distance": 0, + "extrudeMethod": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-extrude --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-extrude --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to extrude. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | +| `distance` | `number` | No | Distance to extrude the faces. Positive values extrude outward along face normals, negative values extrude inward. | +| `extrudeMethod` | `string` | No | Extrusion method: IndividualFaces (each face extrudes independently), FaceNormal (faces extrude as a group along averaged normal), VertexNormal (vertices move along their normals). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + }, + "distance": { + "type": "number" + }, + "extrudeMethod": { + "type": "string", + "enum": [ + "IndividualFaces", + "VertexNormal", + "FaceNormal" + ] + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ExtrudeResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-ExtrudeResponse": { + "type": "object", + "properties": { + "extrudedFaceCount": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "extrudedFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "extrudeMethod": { + "type": "string" + }, + "distance": { + "type": "number" + }, + "newFacesCreated": { + "type": "integer" + }, + "newFaceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + }, + "totalEdgeCount": { + "type": "integer" + } + }, + "required": [ + "extrudedFaceCount", + "distance", + "newFacesCreated", + "totalFaceCount", + "totalVertexCount", + "totalEdgeCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-flip-normals/SKILL.md b/.gemini/skills/probuilder-flip-normals/SKILL.md new file mode 100644 index 0000000..c325892 --- /dev/null +++ b/.gemini/skills/probuilder-flip-normals/SKILL.md @@ -0,0 +1,197 @@ +--- +name: probuilder-flip-normals +description: Reverse the normal direction of selected faces in a `ProBuilderMesh`, flipping them inside-out. Useful for creating interior spaces (a room from the inside of a cube) or fixing inverted faces. Defaults to all faces when no selection is supplied. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Flip face normals in a ProBuilder mesh + +Reverse the normal direction of selected faces in a `ProBuilderMesh`, flipping them inside-out. Useful for creating interior spaces (a room from the inside of a cube) or fixing inverted faces produced by other operations. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `faceIndices` — optional explicit list of face indices to flip. +- `faceDirection` — optional semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). + +When both are omitted, **every face** is flipped. + +## Examples + +- Flip all faces: leave both `faceIndices` and `faceDirection` empty. +- Flip top face only: `faceDirection=Up`. +- Flip specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-flip-normals --input '{ + "gameObjectRef": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-flip-normals --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-flip-normals --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `faceIndices` | `any` | No | Array of face indices to flip. If empty and faceDirection is empty, flips all faces. | +| `faceDirection` | `any` | No | Semantic face selection by direction. If empty and faceIndices is empty, flips all faces. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FlipNormalsResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FlipNormalsResponse": { + "type": "object", + "properties": { + "facesFlipped": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "totalFaceCount": { + "type": "integer" + }, + "totalVertexCount": { + "type": "integer" + } + }, + "required": [ + "facesFlipped", + "totalFaceCount", + "totalVertexCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-get-mesh-info/SKILL.md b/.gemini/skills/probuilder-get-mesh-info/SKILL.md new file mode 100644 index 0000000..be313ee --- /dev/null +++ b/.gemini/skills/probuilder-get-mesh-info/SKILL.md @@ -0,0 +1,333 @@ +--- +name: probuilder-get-mesh-info +description: "Inspect a `ProBuilderMesh` — face/vertex/edge counts plus optional face-by-face detail. Use `detail=\"summary\"` for a token-efficient overview, `detail=\"full\"` for detailed face data. Often skippable when other tools accept `faceDirection` semantic selection." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Get ProBuilder mesh information + +Inspect a `ProBuilderMesh` — totals (face/vertex/edge counts) plus optional face-by-face detail (per-face vertex positions, edges, semantic direction). The other ProBuilder tools accept `faceDirection` (semantic selection like `"up"`, `"down"`) — when that suffices, you can skip this call entirely. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `detail` — `Summary` (default, cheap overview with face directions) or `Full` (per-face data). +- `includeVertexPositions` — `Full` only. Include each face's vertex positions in the response. +- `includeEdges` — `Full` only. Include each face's edges. Default `true`. +- `maxFacesToShow` — `Full` only. Cap on face-detail entries (default `20`; pass `-1` for all). Keeps the response small for high-face meshes. + +## Tip + +With semantic face selection (`faceDirection`) available on Extrude / DeleteFaces / SetFaceMaterial and friends, you often don't need this tool — just pass `faceDirection="up"` etc. directly. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-get-mesh-info --input '{ + "gameObjectRef": "string_value", + "detail": "string_value", + "includeVertexPositions": false, + "includeEdges": false, + "maxFacesToShow": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-get-mesh-info --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-get-mesh-info --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `detail` | `string` | No | Detail level for output. | +| `includeVertexPositions` | `boolean` | No | If true, includes detailed vertex positions for each face (only with detail='full'). | +| `includeEdges` | `boolean` | No | If true, includes edge information for each face (only with detail='full'). | +| `maxFacesToShow` | `integer` | No | Maximum number of faces to include in detail (only with detail='full'). Use -1 for all faces. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "detail": { + "type": "string", + "enum": [ + "Summary", + "Full" + ] + }, + "includeVertexPositions": { + "type": "boolean" + }, + "includeEdges": { + "type": "boolean" + }, + "maxFacesToShow": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-GetMeshInfoResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BoundsInfo": { + "type": "object", + "properties": { + "center": { + "type": "string" + }, + "size": { + "type": "string" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + } + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo": { + "type": "object", + "properties": { + "direction": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "firstFaceCenter": { + "type": "string" + } + } + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "triangleCount": { + "type": "integer" + }, + "center": { + "type": "string" + }, + "vertices": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo)" + }, + "edges": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo)" + } + }, + "required": [ + "index", + "vertexCount", + "triangleCount" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-VertexInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "position": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-EdgeInfo": { + "type": "object", + "properties": { + "vertexA": { + "type": "integer" + }, + "vertexB": { + "type": "integer" + }, + "positionA": { + "type": "string" + }, + "positionB": { + "type": "string" + } + }, + "required": [ + "vertexA", + "vertexB" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-GetMeshInfoResponse": { + "type": "object", + "properties": { + "gameObjectName": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "faceCount": { + "type": "integer" + }, + "vertexCount": { + "type": "integer" + }, + "edgeCount": { + "type": "integer" + }, + "triangleCount": { + "type": "integer" + }, + "bounds": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-BoundsInfo" + }, + "faceDirections": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceDirectionInfo)" + }, + "faces": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-FaceInfo)" + }, + "facesShown": { + "type": "integer" + }, + "facesTotal": { + "type": "integer" + }, + "uniqueEdgeCount": { + "type": "integer" + } + }, + "required": [ + "instanceId", + "faceCount", + "vertexCount", + "edgeCount", + "triangleCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-merge-objects/SKILL.md b/.gemini/skills/probuilder-merge-objects/SKILL.md new file mode 100644 index 0000000..1fc7933 --- /dev/null +++ b/.gemini/skills/probuilder-merge-objects/SKILL.md @@ -0,0 +1,241 @@ +--- +name: probuilder-merge-objects +description: Combine multiple `ProBuilderMesh` GameObjects into one merged mesh. The first GameObject in the list becomes the merge target. Source GameObjects are deleted by default. Useful for optimizing draw calls and unifying composite props. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Merge multiple ProBuilder meshes into one + +Combine multiple `ProBuilderMesh` GameObjects into a single merged mesh. The first GameObject in `gameObjectRefs` becomes the merge target — subsequent meshes are absorbed into it. Useful for optimizing draw calls or creating a unified object from parts. + +## Inputs + +- `gameObjectRefs` — array of GameObject references (≥2). Each must carry a `ProBuilderMesh` component. The first reference is the merge target. +- `deleteSourceObjects` — when `true` (default), delete the non-target source GameObjects after merging. Set `false` to keep them in the scene. + +## Example + +Merge a table assembled from four leg meshes and a top into a single GameObject for shipping. + +## Behavior + +All meshes are rebuilt (`ToMesh` → `Refresh`), the resulting GameObject is marked dirty, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-merge-objects --input '{ + "gameObjectRefs": "string_value", + "deleteSourceObjects": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-merge-objects --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-merge-objects --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRefs` | `any` | Yes | Array of GameObject references with ProBuilderMesh components to merge. First object becomes the merge target. | +| `deleteSourceObjects` | `boolean` | No | If true, delete the source GameObjects after merging (except the target). Default is true. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRefs": { + "$ref": "#/$defs/AIGD.GameObjectRef-1" + }, + "deleteSourceObjects": { + "type": "boolean" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef-1": { + "type": "array", + "items": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Find GameObject in opened Prefab or in the active Scene." + } + } + }, + "required": [ + "gameObjectRefs" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MergeObjectsResponse" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + } + }, + "required": [ + "instanceId" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MergeObjectsResponse": { + "type": "object", + "properties": { + "mergedMeshCount": { + "type": "integer" + }, + "resultMeshCount": { + "type": "integer" + }, + "targetObjectName": { + "type": "string" + }, + "targetInstanceId": { + "$ref": "#/$defs/UnityEngine.EntityId" + }, + "objectsDeleted": { + "type": "integer" + }, + "totalFacesBefore": { + "type": "integer" + }, + "totalFacesAfter": { + "type": "integer" + }, + "totalVerticesBefore": { + "type": "integer" + }, + "totalVerticesAfter": { + "type": "integer" + }, + "sourceObjects": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SourceObjectInfo)" + }, + "additionalMeshes": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-AdditionalMeshInfo)" + } + }, + "required": [ + "mergedMeshCount", + "resultMeshCount", + "targetInstanceId", + "objectsDeleted", + "totalFacesBefore", + "totalFacesAfter", + "totalVerticesBefore", + "totalVerticesAfter" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-set-face-material/SKILL.md b/.gemini/skills/probuilder-set-face-material/SKILL.md new file mode 100644 index 0000000..8267fa7 --- /dev/null +++ b/.gemini/skills/probuilder-set-face-material/SKILL.md @@ -0,0 +1,219 @@ +--- +name: probuilder-set-face-material +description: Assign a material to specific faces of a `ProBuilderMesh`, enabling multi-material meshes (e.g., grass on top, dirt on sides). Supply either `faceIndices` (explicit) or `faceDirection` (semantic); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Set material on ProBuilder faces + +Assign a material to specific faces of a `ProBuilderMesh`, enabling multi-material meshes where different faces have different materials (e.g., grass on top, dirt on the sides). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `materialPath` — project path to the material asset (e.g., `Assets/Materials/Grass.mat`) or a bare material name. Required. +- `faceIndices` — explicit array of face indices. +- `faceDirection` — semantic alternative (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `faceIndices` / `faceDirection` is required. + +## Examples + +- Set material on the top face: `faceDirection="up"`. +- Set material on specific faces: `faceIndices=[0, 2, 4]`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-set-face-material --input '{ + "gameObjectRef": "string_value", + "materialPath": "string_value", + "faceIndices": "string_value", + "faceDirection": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-set-face-material --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-set-face-material --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `materialPath` | `string` | Yes | Path to the material asset (e.g., 'Assets/Materials/MyMaterial.mat') or material name. | +| `faceIndices` | `any` | No | Array of face indices to apply the material to. Use this OR faceDirection, not both. Use ProBuilder_GetMeshInfo to get valid face indices. | +| `faceDirection` | `any` | No | Semantic face selection by direction. Use this OR faceIndices, not both. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "materialPath": { + "type": "string" + }, + "faceIndices": { + "$ref": "#/$defs/System.Int32-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef", + "materialPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetFaceMaterialResponse" + } + }, + "$defs": { + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo)": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "required": [ + "index" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetFaceMaterialResponse": { + "type": "object", + "properties": { + "materialName": { + "type": "string" + }, + "materialIndex": { + "type": "integer" + }, + "selectionMethod": { + "type": "string" + }, + "facesUpdated": { + "$ref": "#/$defs/System.Int32-1" + }, + "meshMaterials": { + "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-MaterialInfo)" + } + }, + "required": [ + "materialIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-set-pivot/SKILL.md b/.gemini/skills/probuilder-set-pivot/SKILL.md new file mode 100644 index 0000000..b6e215d --- /dev/null +++ b/.gemini/skills/probuilder-set-pivot/SKILL.md @@ -0,0 +1,195 @@ +--- +name: probuilder-set-pivot +description: Move the pivot (origin) of a `ProBuilderMesh` without shifting the visible geometry. Choose `Center` (mesh bounds), `FirstVertex`, or `Custom` (world-space position). The mesh data is rebaked so the visual position stays fixed. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Set the pivot point of a ProBuilder mesh + +Move the pivot (origin) of a `ProBuilderMesh` without shifting the visible geometry. The mesh data is rebaked so the visual position stays fixed while the GameObject's transform origin moves to the new pivot. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `pivotLocation` — `MeshPivotLocation` enum: `Center` (mesh bounds center), `FirstVertex`, or `Custom`. +- `customPosition` — required when `pivotLocation = Custom`. World-space pivot position. + +## Examples + +- Center the pivot: `pivotLocation=Center`. +- Set pivot to first vertex: `pivotLocation=FirstVertex`. +- Set custom pivot: `pivotLocation=Custom`, `customPosition=(0, 0, 0)`. + +## Behavior + +The mesh is rebuilt (`ToMesh` → `Refresh`), dirty-flagged, and the Editor repaints. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-set-pivot --input '{ + "gameObjectRef": "string_value", + "pivotLocation": "string_value", + "customPosition": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-set-pivot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-set-pivot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `pivotLocation` | `string` | No | Where to place the pivot. | +| `customPosition` | `any` | No | Custom world position for pivot (only used when pivotLocation=Custom). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "pivotLocation": { + "type": "string", + "enum": [ + "Center", + "FirstVertex", + "Custom" + ] + }, + "customPosition": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetPivotResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SetPivotResponse": { + "type": "object", + "properties": { + "pivotLocation": { + "type": "string" + }, + "oldPivot": { + "type": "string" + }, + "newPivot": { + "type": "string" + }, + "offsetApplied": { + "type": "string" + }, + "gameObjectName": { + "type": "string" + }, + "newPosition": { + "type": "string" + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/probuilder-subdivide-edges/SKILL.md b/.gemini/skills/probuilder-subdivide-edges/SKILL.md new file mode 100644 index 0000000..a8af464 --- /dev/null +++ b/.gemini/skills/probuilder-subdivide-edges/SKILL.md @@ -0,0 +1,221 @@ +--- +name: probuilder-subdivide-edges +description: Insert new vertices on selected edges of a `ProBuilderMesh`, splitting each edge into smaller segments. Supply either `edges` (explicit list) or `faceDirection` (subdivides all edges of faces facing that direction); exactly one is required. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Subdivide edges in a ProBuilder mesh + +Insert new vertices on selected edges of a `ProBuilderMesh`, subdividing each into smaller segments. Useful for adding detail to specific edges for further manipulation (extrude, bevel, etc.). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `ProBuilderMesh` component. +- `edges` — explicit list of edges to subdivide, each as `[vertexA, vertexB]`. Use 'probuilder-get-mesh-info' to discover valid edges. +- `faceDirection` — semantic alternative: subdivides all edges of faces pointing this direction (`Up`, `Down`, `Left`, `Right`, `Forward`, `Back`). Exactly one of `edges` / `faceDirection` is required. +- `subdivisions` — number of subdivisions per edge. `1` splits each edge in half, `2` into thirds, and so on. Default `1`. + +## Examples + +- Subdivide all edges of the top face: `faceDirection="up"`, `subdivisions=2`. +- Subdivide specific edges: `edges=[[0,1], [2,3]]`, `subdivisions=1`. + +## How to Call + +```bash +unity-mcp-cli run-tool probuilder-subdivide-edges --input '{ + "gameObjectRef": "string_value", + "edges": "string_value", + "faceDirection": "string_value", + "subdivisions": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool probuilder-subdivide-edges --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool probuilder-subdivide-edges --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject with a ProBuilderMesh component. | +| `edges` | `any` | No | Array of edge definitions. Each edge is [vertexA, vertexB]. Use ProBuilder_GetMeshInfo to get vertex indices. | +| `faceDirection` | `any` | No | Semantic face selection - subdivide all edges of faces facing this direction. | +| `subdivisions` | `integer` | No | Number of subdivisions per edge. 1 = splits edge in half, 2 = splits into thirds, etc. Default is 1. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "edges": { + "$ref": "#/$defs/System.Int32-1-1" + }, + "faceDirection": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection" + }, + "subdivisions": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Int32-1": { + "type": "array", + "items": { + "type": "integer" + } + }, + "System.Int32-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Int32-1" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.FaceDirection": { + "type": "string", + "enum": [ + "Up", + "Down", + "Left", + "Right", + "Forward", + "Back" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SubdivideEdgesResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_ProBuilder-SubdivideEdgesResponse": { + "type": "object", + "properties": { + "selectionMethod": { + "type": "string" + }, + "edgesSubdivided": { + "type": "integer" + }, + "subdivisionsPerEdge": { + "type": "integer" + }, + "newEdgesCreated": { + "type": "integer" + }, + "vertexCountBefore": { + "type": "integer" + }, + "vertexCountAfter": { + "type": "integer" + }, + "verticesAdded": { + "type": "integer" + }, + "edgeCountBefore": { + "type": "integer" + }, + "edgeCountAfter": { + "type": "integer" + }, + "edgesAdded": { + "type": "integer" + }, + "totalFaceCount": { + "type": "integer" + } + }, + "required": [ + "edgesSubdivided", + "subdivisionsPerEdge", + "newEdgesCreated", + "vertexCountBefore", + "vertexCountAfter", + "verticesAdded", + "edgeCountBefore", + "edgeCountAfter", + "edgesAdded", + "totalFaceCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-add-knot/SKILL.md b/.gemini/skills/splines-add-knot/SKILL.md new file mode 100644 index 0000000..099c056 --- /dev/null +++ b/.gemini/skills/splines-add-knot/SKILL.md @@ -0,0 +1,336 @@ +--- +name: splines-add-knot +description: Append a knot to a spline in a `SplineContainer`. A knot is a `BezierKnot` with a local position plus in/out tangents and a rotation. Returns the index of the appended knot. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Add Knot + +Append a new knot to the end of a spline. Knots define the control points the spline curve passes through. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `position` — local-space `Vector3` position of the knot (default zero). +- `tangentIn` — optional in tangent relative to the position (default `(0,0,-1)`). +- `tangentOut` — optional out tangent relative to the position (default `(0,0,1)`). +- `rotation` — optional euler-degrees rotation of the knot (default zero). +- `splineIndex` — which spline in the container to append to (default 0). + +## Behavior + +Builds a `BezierKnot` from the inputs, appends it to the chosen spline, marks the scene dirty, repaints, and returns the appended knot index plus the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-add-knot --input '{ + "gameObjectRef": "string_value", + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-add-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-add-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `position` | `any` | No | Local-space position of the new knot. | +| `tangentIn` | `any` | No | In tangent relative to the knot position. | +| `tangentOut` | `any` | No | Out tangent relative to the knot position. | +| `rotation` | `any` | No | Knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container to append to (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-add-spline/SKILL.md b/.gemini/skills/splines-add-spline/SKILL.md new file mode 100644 index 0000000..488ec5e --- /dev/null +++ b/.gemini/skills/splines-add-spline/SKILL.md @@ -0,0 +1,232 @@ +--- +name: splines-add-spline +description: Add an additional empty `Spline` to an existing `SplineContainer`. A container can hold many splines; this appends one and returns its new index. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Add Spline + +Add a new empty `Spline` to a `SplineContainer`. Use this when you need more than one spline on the same GameObject (e.g. a multi-path container). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `closed` — optional; when true the new spline is a closed loop (default false). + +## Behavior + +Appends a new empty spline to the container, applies the `Closed` flag, marks the scene dirty, repaints, and returns the index of the new spline and the resulting spline count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-add-spline --input '{ + "gameObjectRef": "string_value", + "closed": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-add-spline --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-add-spline --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `closed` | `boolean` | No | If true, the new spline is a closed loop. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "closed": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-AddSplineResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-AddSplineResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the newly added spline." + }, + "splineCount": { + "type": "integer", + "description": "Resulting number of splines in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the new spline is a closed loop." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "splineCount", + "closed", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-container-create/SKILL.md b/.gemini/skills/splines-container-create/SKILL.md new file mode 100644 index 0000000..cb8ff2f --- /dev/null +++ b/.gemini/skills/splines-container-create/SKILL.md @@ -0,0 +1,220 @@ +--- +name: splines-container-create +description: Create a new GameObject with a `SplineContainer` (and one initial empty `Spline`) in the active scene. Optionally set name, position and rotation. Returns the new GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Create Container + +Create a new GameObject hosting a `SplineContainer` component in the active scene. The `SplineContainer` is the authoring component that holds one or more `Spline`s; this tool seeds it with a single empty spline ready for knots. + +## Inputs + +- `name` — optional GameObject name (default `Spline`). +- `position` — optional world `Vector3` position (default zero). +- `rotation` — optional euler-degrees `Vector3` rotation (default zero). +- `closed` — optional; when true the seeded spline is a closed loop (default false). + +## Behavior + +Creates the GameObject, adds a `SplineContainer` with one empty spline, applies transform and the `Closed` flag, marks the scene dirty, repaints the Editor, and returns the new GameObject reference and instanceId. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-container-create --input '{ + "name": "string_value", + "position": "string_value", + "rotation": "string_value", + "closed": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-container-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-container-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | Name of the new SplineContainer GameObject. | +| `position` | `any` | No | World-space position of the GameObject. | +| `rotation` | `any` | No | World-space rotation of the GameObject in euler angles (degrees). | +| `closed` | `boolean` | No | If true, the seeded spline is a closed loop. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "closed": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerCreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerCreateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created SplineContainer component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created GameObject." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the created GameObject." + }, + "splineCount": { + "type": "integer", + "description": "Number of splines in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the seeded spline is a closed loop." + } + }, + "required": [ + "instanceId", + "splineCount", + "closed" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-evaluate/SKILL.md b/.gemini/skills/splines-evaluate/SKILL.md new file mode 100644 index 0000000..26c296a --- /dev/null +++ b/.gemini/skills/splines-evaluate/SKILL.md @@ -0,0 +1,268 @@ +--- +name: splines-evaluate +description: Evaluate a spline at normalized parameter `t` in [0,1], returning the local-space and world-space position, the tangent (direction of travel), and the up vector. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Evaluate + +Sample a spline at a point along its length. `t` is normalized: 0 is the first knot, 1 is the last knot (or the loop point for a closed spline). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `t` — normalized parameter in [0,1] (default 0.5). Values outside are clamped. +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Evaluates local position / tangent / up via `Spline.Evaluate`, transforms the position into world space using the container's transform, and returns all of them. The spline must have at least 2 knots. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-evaluate --input '{ + "gameObjectRef": "string_value", + "t": 0, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-evaluate --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-evaluate --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `t` | `number` | No | Normalized parameter along the spline in [0,1] (clamped). Default 0.5. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "t": { + "type": "number" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-EvaluateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-EvaluateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the evaluated spline in the container." + }, + "t": { + "type": "number", + "description": "Normalized parameter actually evaluated (after clamping)." + }, + "localPosition": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position at t." + }, + "worldPosition": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "World-space position at t." + }, + "tangent": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Tangent (direction of travel) at t." + }, + "up": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Up vector at t." + } + }, + "required": [ + "splineIndex", + "t", + "localPosition", + "worldPosition", + "tangent", + "up" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-get-knots/SKILL.md b/.gemini/skills/splines-get-knots/SKILL.md new file mode 100644 index 0000000..ebd0253 --- /dev/null +++ b/.gemini/skills/splines-get-knots/SKILL.md @@ -0,0 +1,293 @@ +--- +name: splines-get-knots +description: "Read all knots of a spline in a `SplineContainer`: per-knot position, in/out tangents, rotation, and tangent mode, plus the closed flag. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Get Knots + +Inspect the knots of a specific spline. Useful before editing to know the indices, positions, and tangent modes. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Enumerates every knot of the chosen spline and returns a per-knot summary plus the spline's `Closed` flag. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-get-knots --input '{ + "gameObjectRef": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-get-knots --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-get-knots --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-GetKnotsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-GetKnotsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the spline in the container." + }, + "closed": { + "type": "boolean", + "description": "Whether the spline is a closed loop." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "knots": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo-1", + "description": "Per-knot summaries." + } + }, + "required": [ + "splineIndex", + "closed", + "knotCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-get/SKILL.md b/.gemini/skills/splines-get/SKILL.md new file mode 100644 index 0000000..21c3264 --- /dev/null +++ b/.gemini/skills/splines-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: splines-get +description: "Generic read: serialize any Splines `Component` (a type in the `UnityEngine.Splines` namespace, e.g. `SplineContainer`, `SplineInstantiate`, `SplineAnimate`) on a GameObject via ReflectorNet. Pair with 'splines-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Get Component + +Serialize any Splines component on a GameObject using ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Splines component; otherwise the first component whose type lives in the `UnityEngine.Splines` namespace is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target Splines component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Splines component. | +| `componentRef` | `any` | No | Optional reference to a specific Splines component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-insert-knot/SKILL.md b/.gemini/skills/splines-insert-knot/SKILL.md new file mode 100644 index 0000000..d99842d --- /dev/null +++ b/.gemini/skills/splines-insert-knot/SKILL.md @@ -0,0 +1,342 @@ +--- +name: splines-insert-knot +description: Insert a knot at a specific index in a spline, shifting later knots forward. Use this to add a control point in the middle of an existing path. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Insert Knot + +Insert a new knot at a given index in a spline. Knots at and after the index shift forward by one. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index to insert at (0..knotCount; required). +- `position` — local-space `Vector3` position of the knot (default zero). +- `tangentIn` / `tangentOut` — optional tangents (defaults `(0,0,-1)` / `(0,0,1)`). +- `rotation` — optional euler-degrees rotation (default zero). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Validates the index range (0..count inclusive), builds a `BezierKnot`, inserts it, marks dirty, repaints, and returns the inserted knot index and the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-insert-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-insert-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-insert-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index at which to insert the knot (0..knotCount). | +| `position` | `any` | No | Local-space position of the new knot. | +| `tangentIn` | `any` | No | In tangent relative to the knot position. | +| `tangentOut` | `any` | No | Out tangent relative to the knot position. | +| `rotation` | `any` | No | Knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-list/SKILL.md b/.gemini/skills/splines-list/SKILL.md new file mode 100644 index 0000000..cb7b19e --- /dev/null +++ b/.gemini/skills/splines-list/SKILL.md @@ -0,0 +1,224 @@ +--- +name: splines-list +description: List every `SplineContainer` in the active scene with its name, spline count, and the knot count of each spline. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / List Containers + +Enumerate the `SplineContainer`s in the active scene. For each, returns a reference, the name, the number of splines, and per-spline knot counts and closed flags. + +## Inputs + +- `includeInactive` (bool, default true) — include containers on inactive/disabled GameObjects. + +## Behavior + +Finds all `SplineContainer` instances and summarizes them. Read-only. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include containers on inactive/disabled GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "name": { + "type": "string", + "description": "Name of the container GameObject." + }, + "splineCount": { + "type": "integer", + "description": "Number of splines in the container." + }, + "splines": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary-1", + "description": "Per-spline summaries." + } + }, + "required": [ + "splineCount" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplineSummary": { + "type": "object", + "properties": { + "splineIndex": { + "type": "integer", + "description": "Index of the spline in the container." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "closed": { + "type": "boolean", + "description": "Whether the spline is a closed loop." + } + }, + "required": [ + "splineIndex", + "knotCount", + "closed" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of SplineContainers found." + }, + "containers": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-ContainerListItem-1", + "description": "The SplineContainers in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-modify/SKILL.md b/.gemini/skills/splines-modify/SKILL.md new file mode 100644 index 0000000..aede7db --- /dev/null +++ b/.gemini/skills/splines-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: splines-modify +description: "Generic write: apply a `SerializedMember` diff to any Splines `Component` on a GameObject via ReflectorNet `TryModify`. Use 'splines-get' first to inspect the structure so the diff is targeted. Fields go through the `fields` channel, properties through `props` (no cross-fallback)." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Modify Component + +Modify any Splines component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Public fields MUST be supplied through the `fields` channel and properties through `props`; ReflectorNet does not cross-fall-back. +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Splines component; otherwise the first component in the `UnityEngine.Splines` namespace is used. + +## Behavior + +Finds the target Splines component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Splines component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific Splines component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SplinesModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-remove-knot/SKILL.md b/.gemini/skills/splines-remove-knot/SKILL.md new file mode 100644 index 0000000..f187c96 --- /dev/null +++ b/.gemini/skills/splines-remove-knot/SKILL.md @@ -0,0 +1,299 @@ +--- +name: splines-remove-knot +description: "Remove the knot at a given index from a spline, shifting later knots back. Destructive: the removed control point is gone." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Remove Knot + +Remove a knot at a specific index from a spline. Knots after the index shift back by one. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot to remove (0..knotCount-1; required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Validates the index range, removes the knot via `Spline.RemoveAt`, marks the scene dirty, repaints, and returns the spline's new knot count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-remove-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-remove-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-remove-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to remove (0..knotCount-1). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-set-closed/SKILL.md b/.gemini/skills/splines-set-closed/SKILL.md new file mode 100644 index 0000000..fdba0ec --- /dev/null +++ b/.gemini/skills/splines-set-closed/SKILL.md @@ -0,0 +1,238 @@ +--- +name: splines-set-closed +description: Toggle whether a spline is a closed loop. A closed spline connects its last knot back to its first, forming a continuous loop. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Closed + +Set the `Closed` flag of a spline. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `closed` — true to close the loop, false to open it (default true). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Assigns `Spline.Closed`, marks the scene dirty, repaints, and returns the resulting state. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-closed --input '{ + "gameObjectRef": "string_value", + "closed": false, + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-closed --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-closed --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `closed` | `boolean` | No | True to close the loop, false to open it. | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "closed": { + "type": "boolean" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SetClosedResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-SetClosedResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "closed": { + "type": "boolean", + "description": "Resulting closed-loop state." + }, + "knotCount": { + "type": "integer", + "description": "Number of knots in the spline." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "closed", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-set-knot/SKILL.md b/.gemini/skills/splines-set-knot/SKILL.md new file mode 100644 index 0000000..19e91ce --- /dev/null +++ b/.gemini/skills/splines-set-knot/SKILL.md @@ -0,0 +1,342 @@ +--- +name: splines-set-knot +description: Set position, in/out tangents, and/or rotation of an existing knot in a spline. Only the fields you pass are changed; the rest are preserved. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Knot + +Edit an existing knot in place. `BezierKnot` is a value type, so this reads the current knot, applies only the provided fields, and writes it back through the spline indexer (which rebuilds the cached curve). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot to edit (required). +- `position` — optional new local-space position. +- `tangentIn` / `tangentOut` — optional new tangents. +- `rotation` — optional new euler-degrees rotation. +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Reads the knot, overrides only the supplied fields, writes it back, marks the scene dirty, repaints, and returns the resulting knot summary. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-knot --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "position": "string_value", + "tangentIn": "string_value", + "tangentOut": "string_value", + "rotation": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-knot --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-knot --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to edit (0..knotCount-1). | +| `position` | `any` | No | New local-space position of the knot. | +| `tangentIn` | `any` | No | New in tangent relative to the knot position. | +| `tangentOut` | `any` | No | New out tangent relative to the knot position. | +| `rotation` | `any` | No | New knot rotation in euler angles (degrees). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "rotation": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "knotIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/splines-set-tangent-mode/SKILL.md b/.gemini/skills/splines-set-tangent-mode/SKILL.md new file mode 100644 index 0000000..fc4c86f --- /dev/null +++ b/.gemini/skills/splines-set-tangent-mode/SKILL.md @@ -0,0 +1,306 @@ +--- +name: splines-set-tangent-mode +description: "Set the `TangentMode` of a knot in a spline. Valid modes: Linear, Continuous, Broken, AutoSmooth, Mirrored. The mode controls how the knot's in/out tangents are computed." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Splines / Set Tangent Mode + +Change how a knot's tangents behave by setting its `TangentMode`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `SplineContainer` (required). +- `knotIndex` — the index of the knot (required). +- `tangentMode` — one of `Linear`, `Continuous`, `Broken`, `AutoSmooth`, `Mirrored` (case-insensitive, required). +- `splineIndex` — which spline in the container (default 0). + +## Behavior + +Parses the mode, applies it via `Spline.SetTangentMode(index, mode)`, marks the scene dirty, repaints, and returns the resulting knot summary. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool splines-set-tangent-mode --input '{ + "gameObjectRef": "string_value", + "knotIndex": 0, + "tangentMode": "string_value", + "splineIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool splines-set-tangent-mode --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool splines-set-tangent-mode --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the SplineContainer component. | +| `knotIndex` | `integer` | Yes | Index of the knot to edit (0..knotCount-1). | +| `tangentMode` | `string` | Yes | Tangent mode: Linear, Continuous, Broken, AutoSmooth, or Mirrored (case-insensitive). | +| `splineIndex` | `integer` | No | Index of the spline inside the container (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "knotIndex": { + "type": "integer" + }, + "tangentMode": { + "type": "string" + }, + "splineIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "knotIndex", + "tangentMode" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the knot inside the spline." + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Local-space position of the knot." + }, + "tangentIn": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "In tangent (relative to the knot position)." + }, + "tangentOut": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Out tangent (relative to the knot position)." + }, + "rotationEuler": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Knot rotation in euler angles (degrees)." + }, + "tangentMode": { + "type": "string", + "description": "Tangent mode of the knot." + } + }, + "required": [ + "index", + "position", + "tangentIn", + "tangentOut", + "rotationEuler" + ] + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotMutationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the SplineContainer GameObject." + }, + "containerRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the SplineContainer component." + }, + "splineIndex": { + "type": "integer", + "description": "Index of the affected spline in the container." + }, + "knotIndex": { + "type": "integer", + "description": "Index of the affected knot in the spline (-1 when not applicable)." + }, + "knotCount": { + "type": "integer", + "description": "Resulting number of knots in the spline." + }, + "knot": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Splines-KnotInfo", + "description": "Summary of the affected knot, when applicable." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "splineIndex", + "knotIndex", + "knotCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-add-layer/SKILL.md b/.gemini/skills/terrain-add-layer/SKILL.md new file mode 100644 index 0000000..c2bbb0c --- /dev/null +++ b/.gemini/skills/terrain-add-layer/SKILL.md @@ -0,0 +1,244 @@ +--- +name: terrain-add-layer +description: Add a `TerrainLayer` to a `Terrain`. Provide either the asset path of an existing `.terrainlayer` asset, or a texture asset path to build a new TerrainLayer from. Returns the index of the added layer. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Add Layer + +Append a `TerrainLayer` to a `Terrain`'s `TerrainData.terrainLayers`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `terrainLayerAssetPath` — optional project path to an existing `.terrainlayer` asset to add. +- `diffuseTextureAssetPath` — optional project path to a `Texture2D`. When `terrainLayerAssetPath` is omitted, a new `TerrainLayer` is created in-memory with this diffuse texture and added. +- `tileSizeX` / `tileSizeY` — tile size (world units) for a newly-created layer (default 15,15). + +## Behavior + +Loads or creates the `TerrainLayer`, appends it to `TerrainData.terrainLayers`, marks the asset + scene dirty, repaints, and returns the new layer index. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-add-layer --input '{ + "gameObjectRef": "string_value", + "terrainLayerAssetPath": "string_value", + "diffuseTextureAssetPath": "string_value", + "tileSizeX": 0, + "tileSizeY": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-add-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-add-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `terrainLayerAssetPath` | `string` | No | Optional project path to an existing .terrainlayer asset to add. | +| `diffuseTextureAssetPath` | `string` | No | Optional project path to a Texture2D used to build a new TerrainLayer (when no asset path is given). | +| `tileSizeX` | `number` | No | Tile size X (world units) for a newly-created layer. | +| `tileSizeY` | `number` | No | Tile size Y (world units) for a newly-created layer. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "terrainLayerAssetPath": { + "type": "string" + }, + "diffuseTextureAssetPath": { + "type": "string" + }, + "tileSizeX": { + "type": "number" + }, + "tileSizeY": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainAddLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainAddLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerIndex": { + "type": "integer", + "description": "Index of the added TerrainLayer." + }, + "layerCount": { + "type": "integer", + "description": "Total number of TerrainLayers after the add." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerIndex", + "layerCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-create/SKILL.md b/.gemini/skills/terrain-create/SKILL.md new file mode 100644 index 0000000..ce483b6 --- /dev/null +++ b/.gemini/skills/terrain-create/SKILL.md @@ -0,0 +1,261 @@ +--- +name: terrain-create +description: Create a new GameObject with a `Terrain` + `TerrainCollider` backed by a freshly created `TerrainData` asset. Set heightmap resolution and the terrain world size (width/height/length). Returns the new GameObject reference and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Create Terrain + +Create a new GameObject hosting a `Terrain` and a `TerrainCollider` in the active scene, backed by a new `TerrainData` asset saved to the project. + +## Inputs + +- `name` — optional GameObject name (default `Terrain`). +- `terrainDataAssetPath` — project path for the new `TerrainData` asset (default `Assets/TerrainData_.asset`). Must start with `Assets/` and end with `.asset`. +- `heightmapResolution` — heightmap resolution; rounded to a valid `2^n + 1` value (default 513). +- `width` / `length` — horizontal terrain size in world units (X / Z, default 1000 each). +- `height` — vertical terrain size in world units (Y, default 600). +- `position` — optional world position of the terrain GameObject (default zero). + +## Behavior + +Creates the `TerrainData`, sets its `heightmapResolution` and `size`, writes it as an asset, then creates the GameObject via `Terrain.CreateTerrainGameObject`, positions it, marks the scene dirty, repaints, and returns the new GameObject reference and instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-create --input '{ + "name": "string_value", + "terrainDataAssetPath": "string_value", + "heightmapResolution": 0, + "width": 0, + "length": 0, + "height": 0, + "position": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `name` | `string` | No | Name of the new Terrain GameObject. | +| `terrainDataAssetPath` | `string` | No | Project path for the new TerrainData asset (Assets/...asset). Defaults to Assets/TerrainData_.asset. | +| `heightmapResolution` | `integer` | No | Heightmap resolution. Rounded up to a valid (2^n + 1) value. | +| `width` | `number` | No | Terrain width in world units (X axis). | +| `length` | `number` | No | Terrain length in world units (Z axis). | +| `height` | `number` | No | Terrain height in world units (Y axis). | +| `position` | `any` | No | World-space position of the terrain GameObject. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "terrainDataAssetPath": { + "type": "string" + }, + "heightmapResolution": { + "type": "integer" + }, + "width": { + "type": "number" + }, + "length": { + "type": "number" + }, + "height": { + "type": "number" + }, + "position": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainCreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainCreateResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created Terrain component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created GameObject." + }, + "gameObjectName": { + "type": "string", + "description": "Name of the created GameObject." + }, + "terrainDataAssetPath": { + "type": "string", + "description": "Project path of the created TerrainData asset." + }, + "heightmapResolution": { + "type": "integer", + "description": "Resolved heightmap resolution." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved terrain size (X=width, Y=height, Z=length)." + } + }, + "required": [ + "instanceId", + "heightmapResolution", + "size" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-get-component/SKILL.md b/.gemini/skills/terrain-get-component/SKILL.md new file mode 100644 index 0000000..2b969b0 --- /dev/null +++ b/.gemini/skills/terrain-get-component/SKILL.md @@ -0,0 +1,295 @@ +--- +name: terrain-get-component +description: "Generic read: serialize a terrain-related `Component` (`Terrain` or `TerrainCollider`) on a GameObject via ReflectorNet. The escape hatch for fields not covered by the dedicated tools. Pair with 'terrain-modify-component'. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Get Component (generic) + +Serialize a terrain component on a GameObject using ReflectorNet. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one; otherwise the first `Terrain` (or, failing that, the first `TerrainCollider`) is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target terrain component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-get-component --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-get-component --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-get-component --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the terrain component. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetComponentResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetComponentResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-get/SKILL.md b/.gemini/skills/terrain-get/SKILL.md new file mode 100644 index 0000000..26c8a4c --- /dev/null +++ b/.gemini/skills/terrain-get/SKILL.md @@ -0,0 +1,311 @@ +--- +name: terrain-get +description: Inspect a `Terrain` — its `TerrainData` size, heightmap / alphamap / detail resolutions, the list of TerrainLayers, tree/detail prototype counts, tree-instance count, and neighbor terrains. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Get Terrain + +Inspect a `Terrain` component in the active scene and report its `TerrainData` configuration. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). + +## Behavior + +Reads `TerrainData.size`, `heightmapResolution`, `alphamapResolution`, `detailResolution`, the `terrainLayers` (with their diffuse-texture names), the tree- and detail-prototype counts, the number of placed tree instances, and the left/top/right/bottom neighbor terrains. Read-only — nothing is mutated. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-get --input '{ + "gameObjectRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Index of the layer in the terrain's layer list." + }, + "name": { + "type": "string", + "description": "Name of the TerrainLayer asset." + }, + "assetPath": { + "type": "string", + "description": "Project asset path of the TerrainLayer, or null." + }, + "diffuseTexture": { + "type": "string", + "description": "Name of the layer's diffuse texture, or null." + } + }, + "required": [ + "index" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Terrain size (X=width, Y=height, Z=length) in world units." + }, + "heightmapResolution": { + "type": "integer", + "description": "Heightmap resolution." + }, + "alphamapResolution": { + "type": "integer", + "description": "Alphamap (splatmap) resolution." + }, + "detailResolution": { + "type": "integer", + "description": "Detail resolution." + }, + "layers": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainLayerInfo-1", + "description": "The TerrainLayers assigned to the terrain." + }, + "treePrototypeCount": { + "type": "integer", + "description": "Number of tree prototypes." + }, + "detailPrototypeCount": { + "type": "integer", + "description": "Number of detail prototypes." + }, + "treeInstanceCount": { + "type": "integer", + "description": "Number of placed tree instances." + }, + "leftNeighbor": { + "type": "string", + "description": "Name of the left neighbor terrain, or null." + }, + "topNeighbor": { + "type": "string", + "description": "Name of the top neighbor terrain, or null." + }, + "rightNeighbor": { + "type": "string", + "description": "Name of the right neighbor terrain, or null." + }, + "bottomNeighbor": { + "type": "string", + "description": "Name of the bottom neighbor terrain, or null." + } + }, + "required": [ + "size", + "heightmapResolution", + "alphamapResolution", + "detailResolution", + "treePrototypeCount", + "detailPrototypeCount", + "treeInstanceCount" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-list/SKILL.md b/.gemini/skills/terrain-list/SKILL.md new file mode 100644 index 0000000..19809ae --- /dev/null +++ b/.gemini/skills/terrain-list/SKILL.md @@ -0,0 +1,222 @@ +--- +name: terrain-list +description: List every `Terrain` in the active scene with its name, world size, heightmap resolution, and TerrainLayer count. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / List Terrains + +List every `Terrain` in the active scene. + +## Inputs + +- `includeInactive` (bool, default true) — include Terrains on inactive/disabled GameObjects. + +## Behavior + +Finds all `Terrain` instances, and for each returns the GameObject reference, the name, the `TerrainData.size`, the heightmap resolution, and the number of TerrainLayers. Read-only. The whole call runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include Terrains on inactive/disabled GameObjects; if false, only active ones. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "name": { + "type": "string", + "description": "Name of the terrain GameObject." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Terrain size (X=width, Y=height, Z=length)." + }, + "heightmapResolution": { + "type": "integer", + "description": "Heightmap resolution." + }, + "layerCount": { + "type": "integer", + "description": "Number of TerrainLayers assigned." + } + }, + "required": [ + "size", + "heightmapResolution", + "layerCount" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of Terrains found." + }, + "terrains": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainListItem-1", + "description": "The Terrains in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-modify-component/SKILL.md b/.gemini/skills/terrain-modify-component/SKILL.md new file mode 100644 index 0000000..95d421c --- /dev/null +++ b/.gemini/skills/terrain-modify-component/SKILL.md @@ -0,0 +1,307 @@ +--- +name: terrain-modify-component +description: "Generic write: apply a `SerializedMember` diff to a terrain-related `Component` (`Terrain` or `TerrainCollider`) via ReflectorNet `TryModify`. Use 'terrain-get-component' first to inspect the structure. Route fields through the `fields` channel and properties through `props`." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Modify Component (generic) + +Modify a terrain component by applying a `SerializedMember` diff via ReflectorNet. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Put C# *fields* in the `fields` channel and *properties* in the `props` channel (ReflectorNet resolves them separately — no cross-fallback). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one; otherwise the first `Terrain` (or `TerrainCollider`) is used. + +## Behavior + +Finds the target terrain component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-modify-component --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-modify-component --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-modify-component --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the terrain component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Fields via the 'fields' channel, properties via 'props'. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainModifyComponentResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainModifyComponentResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-paint-layer/SKILL.md b/.gemini/skills/terrain-paint-layer/SKILL.md new file mode 100644 index 0000000..d02a747 --- /dev/null +++ b/.gemini/skills/terrain-paint-layer/SKILL.md @@ -0,0 +1,271 @@ +--- +name: terrain-paint-layer +description: Paint a `TerrainLayer` over a rectangular region (or the whole terrain) by writing the alphamap (splatmap) so the chosen layer has the given weight there and the other layers are reduced proportionally. Alphamap weights are normalized [0,1]. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Paint Layer + +Write the alphamap (splatmap) of a `Terrain` so one `TerrainLayer` dominates a region. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `layerIndex` — index of the `TerrainLayer` to paint (required; must already be on the terrain). +- `xBase` / `yBase` — top-left alphamap cell of the region (default 0,0). +- `width` / `height` — region size in alphamap cells. When <= 0, spans to the alphamap edge. +- `strength` — target normalized [0,1] weight for the chosen layer (default 1 = fully painted). + +## Behavior + +Reads the region alphamaps via `GetAlphamaps`, sets the chosen layer's weight to `strength` and scales the remaining layers so each cell's weights sum to 1, then writes back with `SetAlphamaps`. Destructive. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-paint-layer --input '{ + "gameObjectRef": "string_value", + "layerIndex": 0, + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "strength": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-paint-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-paint-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `layerIndex` | `integer` | Yes | Index of the TerrainLayer to paint (must already be on the terrain). | +| `xBase` | `integer` | No | Top-left alphamap X cell of the region. | +| `yBase` | `integer` | No | Top-left alphamap Y cell of the region. | +| `width` | `integer` | No | Region width in alphamap cells. <= 0 spans to the alphamap edge. | +| `height` | `integer` | No | Region height in alphamap cells. <= 0 spans to the alphamap edge. | +| `strength` | `number` | No | Target normalized [0,1] weight for the chosen layer (1 = fully painted). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "layerIndex": { + "type": "integer" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "strength": { + "type": "number" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "layerIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPaintLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPaintLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerIndex": { + "type": "integer", + "description": "Index of the painted TerrainLayer." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerIndex", + "xBase", + "yBase", + "width", + "height", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-place-trees/SKILL.md b/.gemini/skills/terrain-place-trees/SKILL.md new file mode 100644 index 0000000..f004db1 --- /dev/null +++ b/.gemini/skills/terrain-place-trees/SKILL.md @@ -0,0 +1,304 @@ +--- +name: terrain-place-trees +description: Place trees on a `Terrain` using an existing tree prototype. Either scatter `count` trees randomly across a normalized [0,1] sub-rectangle, or place trees at explicit normalized positions. Optionally clear existing trees first. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Place Trees + +Add `TreeInstance`s to a `Terrain`. Tree positions are normalized [0,1] across the terrain. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `prototypeIndex` — index of the tree prototype to place (must already be on the terrain, default 0). +- `count` — number of trees to scatter randomly (used when `positions` is omitted; default 100). +- `minX` / `minZ` / `maxX` / `maxZ` — normalized [0,1] sub-rectangle to scatter within (default 0..1 on both axes). +- `positions` — optional explicit normalized [0,1] XZ positions (each a `Vector2`, x→X, y→Z). When provided, overrides random scatter. +- `heightScale` / `widthScale` — per-instance scale (default 1). +- `clearExisting` — when `true`, removes existing trees before placing (default false). + +## Behavior + +Validates the prototype index, builds `TreeInstance`s (sampling the terrain height at each normalized position), and assigns them via `TerrainData.SetTreeInstances(..., snapToHeightmap:true)`. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-place-trees --input '{ + "gameObjectRef": "string_value", + "prototypeIndex": 0, + "count": 0, + "minX": 0, + "minZ": 0, + "maxX": 0, + "maxZ": 0, + "positions": "string_value", + "heightScale": 0, + "widthScale": 0, + "clearExisting": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-place-trees --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-place-trees --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `prototypeIndex` | `integer` | No | Index of the tree prototype to place (must already be on the terrain). | +| `count` | `integer` | No | Number of trees to scatter randomly when 'positions' is omitted. | +| `minX` | `number` | No | Normalized [0,1] minimum X of the scatter sub-rectangle. | +| `minZ` | `number` | No | Normalized [0,1] minimum Z of the scatter sub-rectangle. | +| `maxX` | `number` | No | Normalized [0,1] maximum X of the scatter sub-rectangle. | +| `maxZ` | `number` | No | Normalized [0,1] maximum Z of the scatter sub-rectangle. | +| `positions` | `any` | No | Optional explicit normalized [0,1] XZ positions (Vector2: x->X, y->Z). | +| `heightScale` | `number` | No | Per-instance height scale. | +| `widthScale` | `number` | No | Per-instance width scale. | +| `clearExisting` | `boolean` | No | If true, removes existing trees before placing. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "prototypeIndex": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "minX": { + "type": "number" + }, + "minZ": { + "type": "number" + }, + "maxX": { + "type": "number" + }, + "maxZ": { + "type": "number" + }, + "positions": { + "$ref": "#/$defs/UnityEngine.Vector2-1" + }, + "heightScale": { + "type": "number" + }, + "widthScale": { + "type": "number" + }, + "clearExisting": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector2": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + } + }, + "required": [ + "x", + "y" + ], + "additionalProperties": false + }, + "UnityEngine.Vector2-1": { + "type": "array", + "items": { + "$ref": "#/$defs/UnityEngine.Vector2" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPlaceTreesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainPlaceTreesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "prototypeIndex": { + "type": "integer", + "description": "Index of the placed tree prototype." + }, + "treesAdded": { + "type": "integer", + "description": "Number of trees added by this call." + }, + "treeInstanceCount": { + "type": "integer", + "description": "Total tree instance count after the call." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "prototypeIndex", + "treesAdded", + "treeInstanceCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-remove-layer/SKILL.md b/.gemini/skills/terrain-remove-layer/SKILL.md new file mode 100644 index 0000000..7905b18 --- /dev/null +++ b/.gemini/skills/terrain-remove-layer/SKILL.md @@ -0,0 +1,223 @@ +--- +name: terrain-remove-layer +description: Remove a `TerrainLayer` from a `Terrain` by its index. Returns the remaining layer count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Remove Layer + +Remove a `TerrainLayer` from a `Terrain`'s `TerrainData.terrainLayers` by index. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `layerIndex` — index of the layer to remove (required). + +## Behavior + +Validates the index against the current layer count, removes the layer, reassigns `TerrainData.terrainLayers`, marks the asset + scene dirty, repaints, and returns the remaining layer count. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-remove-layer --input '{ + "gameObjectRef": "string_value", + "layerIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-remove-layer --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-remove-layer --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `layerIndex` | `integer` | Yes | Index of the TerrainLayer to remove. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "layerIndex": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "layerIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainRemoveLayerResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainRemoveLayerResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "layerCount": { + "type": "integer", + "description": "Total number of TerrainLayers after the removal." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "layerCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-sample-heights/SKILL.md b/.gemini/skills/terrain-sample-heights/SKILL.md new file mode 100644 index 0000000..515044d --- /dev/null +++ b/.gemini/skills/terrain-sample-heights/SKILL.md @@ -0,0 +1,285 @@ +--- +name: terrain-sample-heights +description: Read heightmap values over a rectangular region (or the whole terrain) of a `Terrain`. Returns the normalized [0,1] heights plus min/max/average statistics. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Sample Heights + +Sample heightmap values from a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `xBase` / `yBase` — top-left heightmap cell of the region (default 0,0). +- `width` / `height` — region size in heightmap cells. When <= 0, the region spans to the edge of the heightmap from the base. +- `includeArray` — when `true`, include the full row-major `[height][width]` heights array in the response (can be large); otherwise only statistics are returned (default false). + +## Behavior + +Resolves and clamps the region against `heightmapResolution`, calls `TerrainData.GetHeights`, computes min/max/average over the sampled cells, and optionally returns the full array. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-sample-heights --input '{ + "gameObjectRef": "string_value", + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "includeArray": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-sample-heights --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-sample-heights --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `xBase` | `integer` | No | Top-left heightmap X cell of the region. | +| `yBase` | `integer` | No | Top-left heightmap Y cell of the region. | +| `width` | `integer` | No | Region width in heightmap cells. <= 0 spans to the heightmap edge. | +| `height` | `integer` | No | Region height in heightmap cells. <= 0 spans to the heightmap edge. | +| `includeArray` | `boolean` | No | If true, include the full row-major [height][width] heights array in the response. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "includeArray": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSampleHeightsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + }, + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSampleHeightsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "min": { + "type": "number", + "description": "Minimum normalized [0,1] height in the region." + }, + "max": { + "type": "number", + "description": "Maximum normalized [0,1] height in the region." + }, + "average": { + "type": "number", + "description": "Average normalized [0,1] height in the region." + }, + "heights": { + "$ref": "#/$defs/System.Single-1-1", + "description": "Row-major [height][width] heights array, or null when includeArray is false." + } + }, + "required": [ + "xBase", + "yBase", + "width", + "height", + "min", + "max", + "average" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-detail-prototypes/SKILL.md b/.gemini/skills/terrain-set-detail-prototypes/SKILL.md new file mode 100644 index 0000000..ee29b32 --- /dev/null +++ b/.gemini/skills/terrain-set-detail-prototypes/SKILL.md @@ -0,0 +1,236 @@ +--- +name: terrain-set-detail-prototypes +description: Replace the detail prototypes (grass / detail meshes) of a `Terrain` with a new set built from texture or prefab asset paths. Returns the resulting prototype count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Detail Prototypes + +Replace `TerrainData.detailPrototypes` with a new set. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `textureAssetPaths` — optional list of `Texture2D` asset paths; each becomes a Grass-billboard detail prototype. +- `prefabAssetPaths` — optional list of prefab/GameObject asset paths; each becomes a VertexLit detail-mesh prototype. + +At least one of the two lists must be non-empty. + +## Behavior + +Loads each asset, builds a `DetailPrototype` (texture → `usePrototypeMesh=false`+`prototypeTexture`, prefab → `usePrototypeMesh=true`+`prototype`), assigns the array to `TerrainData.detailPrototypes`, marks dirty + repaints, and returns the count. Destructive (replaces existing prototypes). Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-detail-prototypes --input '{ + "gameObjectRef": "string_value", + "textureAssetPaths": "string_value", + "prefabAssetPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-detail-prototypes --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-detail-prototypes --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `textureAssetPaths` | `any` | No | Optional Texture2D asset paths; each becomes a grass-billboard detail prototype. | +| `prefabAssetPaths` | `any` | No | Optional prefab/GameObject asset paths; each becomes a detail-mesh prototype. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "textureAssetPaths": { + "$ref": "#/$defs/System.String-1" + }, + "prefabAssetPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetDetailPrototypesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetDetailPrototypesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "detailPrototypeCount": { + "type": "integer", + "description": "Number of detail prototypes after the set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "detailPrototypeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-heightmap-resolution/SKILL.md b/.gemini/skills/terrain-set-heightmap-resolution/SKILL.md new file mode 100644 index 0000000..a5e7223 --- /dev/null +++ b/.gemini/skills/terrain-set-heightmap-resolution/SKILL.md @@ -0,0 +1,223 @@ +--- +name: terrain-set-heightmap-resolution +description: Set the heightmap resolution of a `Terrain`'s `TerrainData`. The value is rounded up to a valid `2^n + 1`. Changing resolution resamples the existing heightmap. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Heightmap Resolution + +Set the heightmap resolution of a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `heightmapResolution` — requested resolution; rounded up to a valid `2^n + 1` value (clamped to Unity's [33, 4097] range). + +## Behavior + +Assigns `TerrainData.heightmapResolution`. This is destructive: Unity resamples the existing heightmap to the new resolution. Marks the asset + scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-heightmap-resolution --input '{ + "gameObjectRef": "string_value", + "heightmapResolution": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-heightmap-resolution --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-heightmap-resolution --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `heightmapResolution` | `integer` | Yes | Requested heightmap resolution. Rounded up to a valid (2^n + 1) value. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "heightmapResolution": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "heightmapResolution" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightmapResolutionResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightmapResolutionResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "heightmapResolution": { + "type": "integer", + "description": "Resolved heightmap resolution." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "heightmapResolution", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-heights/SKILL.md b/.gemini/skills/terrain-set-heights/SKILL.md new file mode 100644 index 0000000..d9c7cd6 --- /dev/null +++ b/.gemini/skills/terrain-set-heights/SKILL.md @@ -0,0 +1,277 @@ +--- +name: terrain-set-heights +description: Set heightmap values over a rectangular region (or the whole terrain) of a `Terrain`. Either fill the region with a uniform normalized height, or supply an explicit row-major 2D heights array. Heights are normalized [0,1] of the terrain's Y size. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Heights + +Write heightmap values into a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `xBase` / `yBase` — top-left heightmap cell of the region (default 0,0). +- `width` / `height` — region size in heightmap cells. When <= 0, the region spans to the edge of the heightmap from the base. +- `uniformHeight` — when `heights` is omitted, fill the whole region with this normalized [0,1] value (default 0). +- `heights` — optional explicit row-major `[height][width]` array of normalized [0,1] values. When provided, its dimensions define the region size (overriding width/height). + +## Behavior + +Resolves and clamps the region against `heightmapResolution`, builds a `[h,w]` height array (uniform fill or from `heights`), and calls `TerrainData.SetHeights(xBase, yBase, array)`. Destructive: overwrites existing heights in the region. Marks dirty + repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-heights --input '{ + "gameObjectRef": "string_value", + "xBase": 0, + "yBase": 0, + "width": 0, + "height": 0, + "uniformHeight": 0, + "heights": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-heights --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-heights --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `xBase` | `integer` | No | Top-left heightmap X cell of the region. | +| `yBase` | `integer` | No | Top-left heightmap Y cell of the region. | +| `width` | `integer` | No | Region width in heightmap cells. <= 0 spans to the heightmap edge. | +| `height` | `integer` | No | Region height in heightmap cells. <= 0 spans to the heightmap edge. | +| `uniformHeight` | `number` | No | Uniform normalized [0,1] height used to fill the region when 'heights' is omitted. | +| `heights` | `any` | No | Optional explicit row-major [height][width] array of normalized [0,1] heights. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "xBase": { + "type": "integer" + }, + "yBase": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "uniformHeight": { + "type": "number" + }, + "heights": { + "$ref": "#/$defs/System.Single-1-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single-1": { + "type": "array", + "items": { + "type": "number" + } + }, + "System.Single-1-1": { + "type": "array", + "items": { + "$ref": "#/$defs/System.Single-1" + } + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetHeightsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "xBase": { + "type": "integer", + "description": "Resolved region top-left X cell." + }, + "yBase": { + "type": "integer", + "description": "Resolved region top-left Y cell." + }, + "width": { + "type": "integer", + "description": "Resolved region width in cells." + }, + "height": { + "type": "integer", + "description": "Resolved region height in cells." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "xBase", + "yBase", + "width", + "height", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-neighbors/SKILL.md b/.gemini/skills/terrain-set-neighbors/SKILL.md new file mode 100644 index 0000000..97a7d6c --- /dev/null +++ b/.gemini/skills/terrain-set-neighbors/SKILL.md @@ -0,0 +1,248 @@ +--- +name: terrain-set-neighbors +description: Set the neighboring `Terrain`s of a center `Terrain` (left / top / right / bottom) so Unity blends seams and LOD across tiles. Omitted neighbors are treated as null. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Neighbors + +Wire up the neighbor terrains of a center `Terrain` via `Terrain.SetNeighbors`. + +## Inputs + +- `gameObjectRef` — the center Terrain GameObject (required). +- `leftRef` / `topRef` / `rightRef` / `bottomRef` — optional GameObjects hosting the neighboring `Terrain`s. Any omitted side is set to null. + +## Behavior + +Resolves each provided neighbor GameObject to its `Terrain` component, calls `center.SetNeighbors(left, top, right, bottom)`, and triggers `Terrain.Flush()`. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-neighbors --input '{ + "gameObjectRef": "string_value", + "leftRef": "string_value", + "topRef": "string_value", + "rightRef": "string_value", + "bottomRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-neighbors --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-neighbors --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the center Terrain GameObject. | +| `leftRef` | `any` | No | Optional GameObject hosting the left neighbor Terrain. | +| `topRef` | `any` | No | Optional GameObject hosting the top neighbor Terrain. | +| `rightRef` | `any` | No | Optional GameObject hosting the right neighbor Terrain. | +| `bottomRef` | `any` | No | Optional GameObject hosting the bottom neighbor Terrain. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "leftRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "topRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "rightRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "bottomRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetNeighborsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetNeighborsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the center Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the center Terrain component." + }, + "left": { + "type": "string", + "description": "Name of the left neighbor, or null." + }, + "top": { + "type": "string", + "description": "Name of the top neighbor, or null." + }, + "right": { + "type": "string", + "description": "Name of the right neighbor, or null." + }, + "bottom": { + "type": "string", + "description": "Name of the bottom neighbor, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-size/SKILL.md b/.gemini/skills/terrain-set-size/SKILL.md new file mode 100644 index 0000000..525142c --- /dev/null +++ b/.gemini/skills/terrain-set-size/SKILL.md @@ -0,0 +1,257 @@ +--- +name: terrain-set-size +description: Set the world-space size of a `Terrain`'s `TerrainData` — width (X), height (Y), and length (Z). Omitted components keep their current value. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Size + +Set the world-space size of a `Terrain`'s `TerrainData`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `width` — optional new width in world units (X). When omitted, the current width is kept. +- `height` — optional new height in world units (Y). When omitted, the current height is kept. +- `length` — optional new length in world units (Z). When omitted, the current length is kept. + +## Behavior + +Assigns `TerrainData.size` from the provided components (falling back to the current value for any omitted axis). Marks the asset + scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-size --input '{ + "gameObjectRef": "string_value", + "width": "string_value", + "height": "string_value", + "length": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-size --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-size --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `width` | `any` | No | Optional new terrain width in world units (X axis). | +| `height` | `any` | No | Optional new terrain height in world units (Y axis). | +| `length` | `any` | No | Optional new terrain length in world units (Z axis). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "width": { + "$ref": "#/$defs/System.Single" + }, + "height": { + "$ref": "#/$defs/System.Single" + }, + "length": { + "$ref": "#/$defs/System.Single" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Single": { + "type": "number" + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetSizeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetSizeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "size": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resolved terrain size (X=width, Y=height, Z=length)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "size", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/terrain-set-tree-prototypes/SKILL.md b/.gemini/skills/terrain-set-tree-prototypes/SKILL.md new file mode 100644 index 0000000..79da94f --- /dev/null +++ b/.gemini/skills/terrain-set-tree-prototypes/SKILL.md @@ -0,0 +1,229 @@ +--- +name: terrain-set-tree-prototypes +description: Replace the tree prototypes of a `Terrain` with a new set built from prefab/GameObject asset paths. Returns the resulting prototype count. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Terrain / Set Tree Prototypes + +Replace `TerrainData.treePrototypes` with a new set built from prefab asset paths. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Terrain` (required). +- `prefabAssetPaths` — list of prefab/GameObject asset paths; each becomes a `TreePrototype` (required, non-empty). + +## Behavior + +Loads each prefab, builds a `TreePrototype` with `prefab` set, assigns the array to `TerrainData.treePrototypes`, marks dirty + repaints, and returns the count. Destructive (replaces existing prototypes; existing placed tree instances may need re-placing). Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool terrain-set-tree-prototypes --input '{ + "gameObjectRef": "string_value", + "prefabAssetPaths": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool terrain-set-tree-prototypes --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool terrain-set-tree-prototypes --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Terrain component. | +| `prefabAssetPaths` | `any` | Yes | Prefab/GameObject asset paths; each becomes a TreePrototype. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "prefabAssetPaths": { + "$ref": "#/$defs/System.String-1" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "gameObjectRef", + "prefabAssetPaths" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetTreePrototypesResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Terrain-TerrainSetTreePrototypesResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Terrain GameObject." + }, + "terrainRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Terrain component." + }, + "treePrototypeCount": { + "type": "integer", + "description": "Number of tree prototypes after the set." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "treePrototypeCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-box-fill/SKILL.md b/.gemini/skills/tilemap-box-fill/SKILL.md new file mode 100644 index 0000000..5e68b50 --- /dev/null +++ b/.gemini/skills/tilemap-box-fill/SKILL.md @@ -0,0 +1,284 @@ +--- +name: tilemap-box-fill +description: Fill a rectangular region of a Tilemap with a single TileBase asset using Tilemap.BoxFill. The region is defined by an inclusive min and max cell coordinate. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Box Fill + +Fill a rectangular block of cells of a `Tilemap` with one tile via `Tilemap.BoxFill`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `minX`, `minY` — inclusive minimum cell coordinate. +- `maxX`, `maxY` — inclusive maximum cell coordinate. +- `z` — cell Z coordinate (default 0). +- `tileAssetPath` — `Assets/`-rooted path to the `TileBase` asset to fill with (required). + +## Behavior + +Loads the tile, calls `Tilemap.BoxFill(start, tile, minX, minY, maxX, maxY)`, marks the scene dirty, and repaints. Returns the filled cell count. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-box-fill --input '{ + "gameObjectRef": "string_value", + "tileAssetPath": "string_value", + "minX": 0, + "minY": 0, + "maxX": 0, + "maxY": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-box-fill --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-box-fill --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `tileAssetPath` | `string` | Yes | Assets/-rooted path to the TileBase asset to fill the region with. | +| `minX` | `integer` | Yes | Inclusive minimum cell X coordinate. | +| `minY` | `integer` | Yes | Inclusive minimum cell Y coordinate. | +| `maxX` | `integer` | Yes | Inclusive maximum cell X coordinate. | +| `maxY` | `integer` | Yes | Inclusive maximum cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "tileAssetPath": { + "type": "string" + }, + "minX": { + "type": "integer" + }, + "minY": { + "type": "integer" + }, + "maxX": { + "type": "integer" + }, + "maxY": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "tileAssetPath", + "minX", + "minY", + "maxX", + "maxY" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-BoxFillResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-BoxFillResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "minX": { + "type": "integer", + "description": "Resolved minimum X." + }, + "minY": { + "type": "integer", + "description": "Resolved minimum Y." + }, + "maxX": { + "type": "integer", + "description": "Resolved maximum X." + }, + "maxY": { + "type": "integer", + "description": "Resolved maximum Y." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "filledCount": { + "type": "integer", + "description": "Number of cells filled." + }, + "tileAssetPath": { + "type": "string", + "description": "Path of the tile asset used." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "minX", + "minY", + "maxX", + "maxY", + "cellZ", + "filledCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-clear/SKILL.md b/.gemini/skills/tilemap-clear/SKILL.md new file mode 100644 index 0000000..3828a9d --- /dev/null +++ b/.gemini/skills/tilemap-clear/SKILL.md @@ -0,0 +1,253 @@ +--- +name: tilemap-clear +description: "Clear tiles from a Tilemap: either every tile (ClearAllTiles) or a rectangular region (by erasing each cell in the inclusive min..max range). Destructive." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Clear Tiles + +Erase tiles from a `Tilemap`. By default clears the whole map; pass a region to clear only a rectangular block. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `clearAll` (bool, default true) — when true, calls `Tilemap.ClearAllTiles()`; when false, erases the region defined by `minX/minY/maxX/maxY`. +- `minX`, `minY`, `maxX`, `maxY`, `z` — the inclusive region (used only when `clearAll` is false). + +## Behavior + +Either clears all tiles or sets each cell in the region to null, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-clear --input '{ + "gameObjectRef": "string_value", + "clearAll": false, + "minX": 0, + "minY": 0, + "maxX": 0, + "maxY": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-clear --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-clear --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `clearAll` | `boolean` | No | If true (default) clear the entire Tilemap; if false, clear the min..max region only. | +| `minX` | `integer` | No | Inclusive minimum cell X (region mode). | +| `minY` | `integer` | No | Inclusive minimum cell Y (region mode). | +| `maxX` | `integer` | No | Inclusive maximum cell X (region mode). | +| `maxY` | `integer` | No | Inclusive maximum cell Y (region mode). | +| `z` | `integer` | No | Cell Z coordinate (region mode, default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clearAll": { + "type": "boolean" + }, + "minX": { + "type": "integer" + }, + "minY": { + "type": "integer" + }, + "maxX": { + "type": "integer" + }, + "maxY": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ClearResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ClearResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "clearedAll": { + "type": "boolean", + "description": "True when the whole map was cleared." + }, + "clearedCount": { + "type": "integer", + "description": "Number of cells cleared in region mode; -1 when clearedAll." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clearedAll", + "clearedCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-create-rule-tile/SKILL.md b/.gemini/skills/tilemap-create-rule-tile/SKILL.md new file mode 100644 index 0000000..2b7b7e4 --- /dev/null +++ b/.gemini/skills/tilemap-create-rule-tile/SKILL.md @@ -0,0 +1,118 @@ +--- +name: tilemap-create-rule-tile +description: Create a UnityEngine.RuleTile asset (from the 2D Tilemap Extras package) at an Assets/-rooted path, with an optional default Sprite. RuleTiles auto-pick sprites based on neighbour rules — paint them like any tile and add rules afterward via the Inspector or 'tilemap-modify'. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Rule Tile + +Create a `RuleTile` ScriptableObject asset (provided by `com.unity.2d.tilemap.extras`). + +## Inputs + +- `assetPath` — `Assets/`-rooted path ending in `.asset` for the new RuleTile. +- `defaultSpriteAssetPath` — optional `Assets/`-rooted path to a `Sprite` used as the RuleTile's default sprite (shown when no rule matches). + +## Behavior + +Creates the intermediate folders, instantiates a `RuleTile`, assigns the default sprite when supplied, writes the asset via `AssetDatabase.CreateAsset`, saves + refreshes, and returns the asset path. Neighbour rules can then be authored via `tilemap-modify` or the Inspector. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create-rule-tile --input '{ + "assetPath": "string_value", + "defaultSpriteAssetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create-rule-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create-rule-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets/-rooted path ending in '.asset' for the new RuleTile asset. | +| `defaultSpriteAssetPath` | `string` | No | Optional Assets/-rooted path to a Sprite used as the RuleTile default sprite. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "defaultSpriteAssetPath": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateRuleTileResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateRuleTileResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the created RuleTile asset." + }, + "defaultSpriteAssetPath": { + "type": "string", + "description": "Path of the assigned default Sprite, or null." + }, + "ruleCount": { + "type": "integer", + "description": "Number of tiling rules (0 for a fresh RuleTile)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "ruleCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-create-tile-asset/SKILL.md b/.gemini/skills/tilemap-create-tile-asset/SKILL.md new file mode 100644 index 0000000..3e834d7 --- /dev/null +++ b/.gemini/skills/tilemap-create-tile-asset/SKILL.md @@ -0,0 +1,205 @@ +--- +name: tilemap-create-tile-asset +description: Create a UnityEngine.Tilemaps.Tile asset at an Assets/-rooted path and assign a Sprite (loaded from a sprite asset path) plus an optional color and collider type. Returns the created asset path. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Tile Asset + +Create a `Tile` ScriptableObject asset and wire its sprite so it can be painted into a Tilemap. + +## Inputs + +- `assetPath` — `Assets/`-rooted path ending in `.asset` for the new Tile. +- `spriteAssetPath` — optional `Assets/`-rooted path to a `Sprite` asset to assign. +- `color` — optional tile color (default white). +- `colliderType` — optional `None` / `Sprite` / `Grid` (default Sprite). + +## Behavior + +Creates the intermediate folders, instantiates a `Tile`, assigns sprite/color/collider type, writes the asset via `AssetDatabase.CreateAsset`, saves + refreshes, and returns the asset path. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create-tile-asset --input '{ + "assetPath": "string_value", + "spriteAssetPath": "string_value", + "color": "string_value", + "colliderType": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create-tile-asset --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create-tile-asset --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets/-rooted path ending in '.asset' for the new Tile asset. | +| `spriteAssetPath` | `string` | No | Optional Assets/-rooted path to a Sprite asset to assign to the tile. | +| `color` | `any` | No | Optional tile color (default white). | +| `colliderType` | `string` | No | Optional collider type (default Sprite). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "spriteAssetPath": { + "type": "string" + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color" + }, + "colliderType": { + "type": "string", + "enum": [ + "None", + "Sprite", + "Grid" + ] + } + }, + "$defs": { + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateTileAssetResponse" + } + }, + "$defs": { + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateTileAssetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Path of the created Tile asset." + }, + "spriteAssetPath": { + "type": "string", + "description": "Path of the assigned Sprite asset, or null." + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color", + "description": "Tile color." + }, + "colliderType": { + "type": "string", + "description": "Tile collider type." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "color", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-create/SKILL.md b/.gemini/skills/tilemap-create/SKILL.md new file mode 100644 index 0000000..856b5f2 --- /dev/null +++ b/.gemini/skills/tilemap-create/SKILL.md @@ -0,0 +1,267 @@ +--- +name: tilemap-create +description: Create a Grid GameObject with a child Tilemap + TilemapRenderer in the active scene. Optionally parent the Grid under an existing GameObject and name the tilemap. Returns the new tilemap GameObject reference and its instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Create Grid + Tilemap + +Create the standard 2D tilemap hierarchy: a `Grid` GameObject hosting a child GameObject with a `Tilemap` and `TilemapRenderer`. This is the minimal structure required before painting tiles. + +## Inputs + +- `gridName` — optional name for the Grid GameObject (default `Grid`). +- `tilemapName` — optional name for the Tilemap child GameObject (default `Tilemap`). +- `parentRef` — optional GameObject to parent the new Grid under. +- `cellSize` — optional Grid cell size (default `(1,1,0)`). + +## Behavior + +Creates the Grid + child Tilemap/TilemapRenderer, sets the cell size, parents under `parentRef` when supplied, marks the scene dirty, repaints, and returns references + the tilemap GameObject instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-create --input '{ + "gridName": "string_value", + "tilemapName": "string_value", + "parentRef": "string_value", + "cellSize": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gridName` | `string` | No | Name of the Grid GameObject. | +| `tilemapName` | `string` | No | Name of the child Tilemap GameObject. | +| `parentRef` | `any` | No | Optional GameObject to parent the new Grid under. | +| `cellSize` | `any` | No | Grid cell size. Defaults to (1,1,0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gridName": { + "type": "string" + }, + "tilemapName": { + "type": "string" + }, + "parentRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "cellSize": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-CreateResponse": { + "type": "object", + "properties": { + "gridRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Grid GameObject." + }, + "tilemapGameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the created Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created Tilemap component." + }, + "rendererRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the created TilemapRenderer component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the created Tilemap GameObject." + }, + "gridName": { + "type": "string", + "description": "Name of the created Grid GameObject." + }, + "tilemapName": { + "type": "string", + "description": "Name of the created Tilemap GameObject." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-get-tile/SKILL.md b/.gemini/skills/tilemap-get-tile/SKILL.md new file mode 100644 index 0000000..83be7e6 --- /dev/null +++ b/.gemini/skills/tilemap-get-tile/SKILL.md @@ -0,0 +1,293 @@ +--- +name: tilemap-get-tile +description: "Read the tile occupying a single cell of a Tilemap: returns whether the cell has a tile, the tile asset name + path, the tile color, and the collider type at that cell. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Get Tile + +Inspect a single cell of a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the integer cell coordinate (z defaults to 0). + +## Behavior + +Reads `Tilemap.GetTile`, `GetColor`, and `GetColliderType` at the cell and returns them. When the cell is empty, `hasTile` is false. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-get-tile --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-get-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-get-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-GetTileResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-GetTileResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "hasTile": { + "type": "boolean", + "description": "Whether a tile occupies the cell." + }, + "tileName": { + "type": "string", + "description": "Name of the tile asset, or null when empty." + }, + "tileAssetPath": { + "type": "string", + "description": "Asset path of the tile, or null when empty/unsaved." + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color", + "description": "Per-cell tint color." + }, + "colliderType": { + "type": "string", + "description": "Per-cell collider type (None/Sprite/Grid)." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "hasTile", + "color" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-get/SKILL.md b/.gemini/skills/tilemap-get/SKILL.md new file mode 100644 index 0000000..d2ba3c0 --- /dev/null +++ b/.gemini/skills/tilemap-get/SKILL.md @@ -0,0 +1,295 @@ +--- +name: tilemap-get +description: "Generic read: serialize a Tilemap-related `Component` (Tilemap, TilemapRenderer, Grid, or a Tile/RuleTile asset's host) on a GameObject via ReflectorNet. Pair with 'tilemap-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Get Component + +Serialize any Tilemap-related component on a GameObject using ReflectorNet. This is the generic escape hatch for fields/properties not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one Tilemap-related component; otherwise the first `Tilemap` / `TilemapRenderer` / `Grid` is used. +- `deepSerialization` — when `true`, recurses through nested objects; otherwise only top-level members. + +## Behavior + +Finds the target component, serializes it via ReflectorNet, and returns the serialized member plus the resolved component type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-get --input '{ + "gameObjectRef": "string_value", + "componentRef": "string_value", + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap-related component. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapGetResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapGetResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the serialized component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the serialized component." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized component data." + } + }, + "required": [ + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-list/SKILL.md b/.gemini/skills/tilemap-list/SKILL.md new file mode 100644 index 0000000..d2dd636 --- /dev/null +++ b/.gemini/skills/tilemap-list/SKILL.md @@ -0,0 +1,226 @@ +--- +name: tilemap-list +description: List every Tilemap in the active scene with its name, painted-tile count, cell bounds, and orientation. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / List Tilemaps + +Enumerate all `Tilemap` components in the active scene. + +## Inputs + +- `includeInactive` (bool, default true) — include Tilemaps on inactive GameObjects. + +## Behavior + +Finds all `Tilemap` instances, reads each one's `GetUsedTilesCount`, `cellBounds`, and `orientation`, and returns them. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-list --input '{ + "includeInactive": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeInactive` | `boolean` | No | If true (default), include Tilemaps on inactive GameObjects. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeInactive": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "name": { + "type": "string", + "description": "Name of the Tilemap GameObject." + }, + "tileCount": { + "type": "integer", + "description": "Number of painted (used) tiles." + }, + "boundsMin": { + "$ref": "#/$defs/UnityEngine.Vector3Int", + "description": "Inclusive minimum cell bound." + }, + "boundsMax": { + "$ref": "#/$defs/UnityEngine.Vector3Int", + "description": "Exclusive maximum cell bound." + }, + "orientation": { + "type": "string", + "description": "Layout orientation." + } + }, + "required": [ + "tileCount", + "boundsMin", + "boundsMax" + ] + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3Int": { + "type": "object", + "properties": { + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of Tilemaps found." + }, + "tilemaps": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-ListItem-1", + "description": "The Tilemaps in the active scene." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-modify/SKILL.md b/.gemini/skills/tilemap-modify/SKILL.md new file mode 100644 index 0000000..f15a978 --- /dev/null +++ b/.gemini/skills/tilemap-modify/SKILL.md @@ -0,0 +1,307 @@ +--- +name: tilemap-modify +description: "Generic write: apply a `SerializedMember` diff to a Tilemap-related `Component` on a GameObject via ReflectorNet `TryModify`. Fields go through the `fields` channel, properties through `props`. Use 'tilemap-get' first to inspect the structure." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Modify Component + +Modify a Tilemap-related component on a GameObject by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for members not covered by the dedicated tools. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the component (required). +- `data` — the `SerializedMember` diff to apply. Route C# **fields** through the `fields` channel and **properties** through `props` — ReflectorNet resolves each channel strictly with no cross-fallback. +- `componentRef` — optional. Resolves a specific component when the GameObject has more than one. + +## Behavior + +Finds the target component, applies the diff via `Reflector.TryModify`, and on success marks the component + scene dirty and repaints. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-modify --input '{ + "gameObjectRef": "string_value", + "data": "string_value", + "componentRef": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap-related component. | +| `data` | `any` | Yes | The SerializedMember diff to apply. Only include members you want to change. | +| `componentRef` | `any` | No | Optional reference to a specific component if the GameObject has multiple. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + } + }, + "required": [ + "gameObjectRef", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapModifyResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject containing the component." + }, + "componentRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the modified component." + }, + "componentIndex": { + "type": "integer", + "description": "Index of the component in the GameObject's component list." + }, + "componentType": { + "type": "string", + "description": "Full type name of the modified component." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success", + "componentIndex" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-set-collider-type/SKILL.md b/.gemini/skills/tilemap-set-collider-type/SKILL.md new file mode 100644 index 0000000..3cf6282 --- /dev/null +++ b/.gemini/skills/tilemap-set-collider-type/SKILL.md @@ -0,0 +1,260 @@ +--- +name: tilemap-set-collider-type +description: Set the per-cell Tile.ColliderType (None / Sprite / Grid) of a tile painted into a Tilemap. Pair with a TilemapCollider2D to generate physics colliders from the tiles. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile Collider Type + +Override the collider type of a single tile cell in a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the cell coordinate (z defaults to 0). +- `colliderType` — `None`, `Sprite`, or `Grid`. + +## Behavior + +Maps the argument to `UnityEngine.Tilemaps.Tile.ColliderType` and calls `Tilemap.SetColliderType`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-collider-type --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "colliderType": "string_value", + "z": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-collider-type --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-collider-type --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `colliderType` | `string` | Yes | The collider type to set: None, Sprite, or Grid. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "colliderType": { + "type": "string", + "enum": [ + "None", + "Sprite", + "Grid" + ] + }, + "z": { + "type": "integer" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y", + "colliderType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetColliderTypeResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetColliderTypeResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "colliderType": { + "type": "string", + "description": "Resulting collider type." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-set-orientation/SKILL.md b/.gemini/skills/tilemap-set-orientation/SKILL.md new file mode 100644 index 0000000..1b9296c --- /dev/null +++ b/.gemini/skills/tilemap-set-orientation/SKILL.md @@ -0,0 +1,294 @@ +--- +name: tilemap-set-orientation +description: Set the tile anchor (sub-cell pivot, default (0.5,0.5,0)) and/or the layout orientation (XY/XZ/YX/YZ/ZX/ZY/Custom) of a Tilemap. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Anchor + Orientation + +Configure how a `Tilemap` positions and orients its tiles. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `anchor` — optional sub-cell anchor (tile pivot within a cell), default `(0.5,0.5,0)`. +- `orientation` — optional layout plane: `XY` (default 2D), `XZ`, `YX`, `YZ`, `ZX`, `ZY`, `Custom`. + +## Behavior + +Sets `Tilemap.tileAnchor` and/or `Tilemap.orientation`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-orientation --input '{ + "gameObjectRef": "string_value", + "anchor": "string_value", + "orientation": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-orientation --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-orientation --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `anchor` | `any` | No | Optional sub-cell tile anchor (default (0.5,0.5,0)). | +| `orientation` | `any` | No | Optional layout orientation plane. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "anchor": { + "$ref": "#/$defs/UnityEngine.Vector3" + }, + "orientation": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapOrientation" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-TilemapOrientation": { + "type": "string", + "enum": [ + "XY", + "XZ", + "YX", + "YZ", + "ZX", + "ZY", + "Custom" + ] + } + }, + "required": [ + "gameObjectRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetOrientationResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetOrientationResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "tileAnchor": { + "$ref": "#/$defs/UnityEngine.Vector3", + "description": "Resulting tile anchor." + }, + "orientation": { + "type": "string", + "description": "Resulting orientation." + }, + "anchorApplied": { + "type": "boolean", + "description": "True when the anchor was changed." + }, + "orientationApplied": { + "type": "boolean", + "description": "True when the orientation was changed." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "tileAnchor", + "anchorApplied", + "orientationApplied", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-set-tile-flags/SKILL.md b/.gemini/skills/tilemap-set-tile-flags/SKILL.md new file mode 100644 index 0000000..d9782eb --- /dev/null +++ b/.gemini/skills/tilemap-set-tile-flags/SKILL.md @@ -0,0 +1,341 @@ +--- +name: tilemap-set-tile-flags +description: Set the per-cell tint color and/or transform (flip X/Y, Z rotation, scale) of a tile already painted into a Tilemap. Unlocks the relevant TileFlags so the overrides take effect. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile Color + Transform + +Override the per-cell color and transform of a single tile in a `Tilemap`. + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the cell coordinate (z defaults to 0). +- `color` — optional per-cell tint color; unlocks `TileFlags.LockColor` when applied. +- `flipX`, `flipY` — optional booleans to mirror the tile. +- `rotationZ` — optional Z rotation in degrees. +- `scale` — optional uniform/again per-axis scale (default identity). + +## Behavior + +When a color is given, removes `TileFlags.LockColor` then calls `SetColor`. When any transform argument is given, removes `TileFlags.LockTransform` then builds a TRS matrix and calls `SetTransformMatrix`. Marks the scene dirty and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-tile-flags --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0, + "color": "string_value", + "flipX": "string_value", + "flipY": "string_value", + "rotationZ": "string_value", + "scale": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile-flags --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile-flags --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | +| `color` | `any` | No | Optional per-cell tint color. | +| `flipX` | `any` | No | Optional: mirror the tile horizontally. | +| `flipY` | `any` | No | Optional: mirror the tile vertically. | +| `rotationZ` | `any` | No | Optional: Z rotation in degrees. | +| `scale` | `any` | No | Optional per-axis scale (default (1,1,1)). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + }, + "color": { + "$ref": "#/$defs/UnityEngine.Color" + }, + "flipX": { + "$ref": "#/$defs/System.Boolean" + }, + "flipY": { + "$ref": "#/$defs/System.Boolean" + }, + "rotationZ": { + "$ref": "#/$defs/System.Single" + }, + "scale": { + "$ref": "#/$defs/UnityEngine.Vector3" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.Color": { + "type": "object", + "properties": { + "r": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "g": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "b": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "a": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "r", + "g", + "b", + "a" + ], + "additionalProperties": false + }, + "System.Boolean": { + "type": "boolean" + }, + "System.Single": { + "type": "number" + }, + "UnityEngine.Vector3": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileFlagsResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileFlagsResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "colorApplied": { + "type": "boolean", + "description": "True when a color override was applied." + }, + "transformApplied": { + "type": "boolean", + "description": "True when a transform override was applied." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "colorApplied", + "transformApplied", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/tilemap-set-tile/SKILL.md b/.gemini/skills/tilemap-set-tile/SKILL.md new file mode 100644 index 0000000..dbd0d83 --- /dev/null +++ b/.gemini/skills/tilemap-set-tile/SKILL.md @@ -0,0 +1,259 @@ +--- +name: tilemap-set-tile +description: Paint a single tile (a TileBase asset such as a Tile or RuleTile) into a Tilemap at a given cell coordinate. Pass a null/empty tileAssetPath to erase the cell. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Tilemap / Set Tile + +Set the tile at a single cell of a `Tilemap`. The tile is loaded from an `Assets/`-rooted path to any `TileBase` asset (a `Tile`, `RuleTile`, etc.). + +## Inputs + +- `gameObjectRef` — the GameObject hosting the `Tilemap` (required). +- `x`, `y`, `z` — the integer cell coordinate (z defaults to 0). +- `tileAssetPath` — `Assets/`-rooted path to the `TileBase` asset; null/empty erases the cell. + +## Behavior + +Loads the tile asset (when supplied), calls `Tilemap.SetTile(cell, tile)`, marks the scene dirty, and repaints. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool tilemap-set-tile --input '{ + "gameObjectRef": "string_value", + "x": 0, + "y": 0, + "z": 0, + "tileAssetPath": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool tilemap-set-tile --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the GameObject containing the Tilemap component. | +| `x` | `integer` | Yes | Cell X coordinate. | +| `y` | `integer` | Yes | Cell Y coordinate. | +| `z` | `integer` | No | Cell Z coordinate (default 0). | +| `tileAssetPath` | `string` | No | Assets/-rooted path to the TileBase asset to paint. Null/empty erases the cell. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "z": { + "type": "integer" + }, + "tileAssetPath": { + "type": "string" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "gameObjectRef", + "x", + "y" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tilemap-SetTileResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the Tilemap GameObject." + }, + "tilemapRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the Tilemap component." + }, + "cellX": { + "type": "integer", + "description": "Cell X coordinate." + }, + "cellY": { + "type": "integer", + "description": "Cell Y coordinate." + }, + "cellZ": { + "type": "integer", + "description": "Cell Z coordinate." + }, + "tileAssetPath": { + "type": "string", + "description": "Path of the painted tile asset, or null." + }, + "erased": { + "type": "boolean", + "description": "True when the cell was erased (no tile painted)." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "cellX", + "cellY", + "cellZ", + "erased", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-clip-add/SKILL.md b/.gemini/skills/timeline-clip-add/SKILL.md new file mode 100644 index 0000000..757c1af --- /dev/null +++ b/.gemini/skills/timeline-clip-add/SKILL.md @@ -0,0 +1,176 @@ +--- +name: timeline-clip-add +description: Add a clip to a track on a `TimelineAsset`. For AnimationTracks pass an `animationClipPath`; for AudioTracks pass an `audioClipPath`; otherwise a default clip is created. Optionally set start, duration and display name. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Clip + +Add a clip to a track. The clip type depends on the track: an `AnimationTrack` hosts an `AnimationClip`, an `AudioTrack` hosts an `AudioClip`, and other tracks get a default clip. When no source asset is supplied a default (empty) clip is created. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track to add the clip to (name wins; index default 0). +- `animationClipPath` — optional Assets path to an `AnimationClip` (AnimationTrack only). +- `audioClipPath` — optional Assets path to an `AudioClip` (AudioTrack only). +- `start` — optional clip start time in seconds (default 0). +- `duration` — optional clip duration in seconds; when > 0 overrides the default duration. +- `displayName` — optional clip display name. + +## Behavior + +Resolves the track, creates the appropriate clip (typed when a source asset is given, else a default clip), applies start/duration/name, saves the asset, and returns the new clip's index and timing. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-add --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "animationClipPath": "string_value", + "audioClipPath": "string_value", + "start": 0, + "duration": 0, + "displayName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Name of the target track. Takes precedence over trackIndex when provided. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `animationClipPath` | `string` | No | Optional Assets path to an AnimationClip (used for AnimationTracks). | +| `audioClipPath` | `string` | No | Optional Assets path to an AudioClip (used for AudioTracks). | +| `start` | `number` | No | Clip start time in seconds (default 0). | +| `duration` | `number` | No | Clip duration in seconds; when > 0 overrides the default duration. | +| `displayName` | `string` | No | Optional clip display name. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "animationClipPath": { + "type": "string" + }, + "audioClipPath": { + "type": "string" + }, + "start": { + "type": "number" + }, + "duration": { + "type": "number" + }, + "displayName": { + "type": "string" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track the clip was added to." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the new clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Clip start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds." + }, + "end": { + "type": "number", + "description": "Clip end time in seconds." + }, + "assetType": { + "type": "string", + "description": "Type name of the clip's PlayableAsset, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "start", + "duration", + "end", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-clip-move/SKILL.md b/.gemini/skills/timeline-clip-move/SKILL.md new file mode 100644 index 0000000..551b22e --- /dev/null +++ b/.gemini/skills/timeline-clip-move/SKILL.md @@ -0,0 +1,167 @@ +--- +name: timeline-clip-move +description: Move a clip along its track — either to an absolute `start` time or by a relative `deltaSeconds`. Duration is preserved. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Move Clip + +Reposition a clip on its track without changing its duration. Provide either an absolute `start` or a relative `deltaSeconds` (delta is ignored when `start` is supplied). + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track holds the clip (name wins; index default 0). +- `clipIndex` — required zero-based clip index. +- `start` — optional absolute new start time (seconds). +- `deltaSeconds` — optional relative shift (seconds); used only when `start` is null. + +## Behavior + +Computes the new start (clamped to >= 0), sets `clip.start`, saves the asset, and returns the old and new start. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-move --input '{ + "assetPath": "string_value", + "clipIndex": 0, + "trackName": "string_value", + "trackIndex": 0, + "start": "string_value", + "deltaSeconds": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-move --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-move --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `clipIndex` | `integer` | Yes | Zero-based index of the clip on its track. | +| `trackName` | `string` | No | Name of the track holding the clip. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `start` | `any` | No | Optional absolute new start time in seconds. | +| `deltaSeconds` | `number` | No | Optional relative shift in seconds; used only when start is null. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "clipIndex": { + "type": "integer" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "start": { + "$ref": "#/$defs/System.Double" + }, + "deltaSeconds": { + "type": "number" + } + }, + "$defs": { + "System.Double": { + "type": "number" + } + }, + "required": [ + "assetPath", + "clipIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipMoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipMoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track holding the clip." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the clip on its track." + }, + "oldStart": { + "type": "number", + "description": "Previous start time in seconds." + }, + "newStart": { + "type": "number", + "description": "New start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds (unchanged)." + }, + "end": { + "type": "number", + "description": "New end time in seconds." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "oldStart", + "newStart", + "duration", + "end", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-clip-set-timing/SKILL.md b/.gemini/skills/timeline-clip-set-timing/SKILL.md new file mode 100644 index 0000000..9b9cb1f --- /dev/null +++ b/.gemini/skills/timeline-clip-set-timing/SKILL.md @@ -0,0 +1,220 @@ +--- +name: timeline-clip-set-timing +description: "Set the timing of a clip on a Timeline track: start, duration, clip-in (trim), blend-in / blend-out durations, ease-in / ease-out durations, and time scale. Only the values you supply are changed." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Set Clip Timing + +Adjust the timing of an existing clip identified by track + clip index. Any value left null is untouched, so this tool can tweak a single property or several at once. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` / `trackIndex` — which track holds the clip (name wins; index default 0). +- `clipIndex` — required zero-based index of the clip on its track. +- `start` — optional new start time (seconds). +- `duration` — optional new duration (seconds). +- `clipIn` — optional clip-in / trim offset into the source asset (seconds). +- `blendInDuration` / `blendOutDuration` — optional crossfade blend durations (seconds). +- `easeInDuration` / `easeOutDuration` — optional ease (fade) durations (seconds). +- `timeScale` — optional playback time scale of the clip. + +## Behavior + +Resolves the clip, applies each supplied value, saves the asset, and returns the resulting timing. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-clip-set-timing --input '{ + "assetPath": "string_value", + "clipIndex": 0, + "trackName": "string_value", + "trackIndex": 0, + "start": "string_value", + "duration": "string_value", + "clipIn": "string_value", + "blendInDuration": "string_value", + "blendOutDuration": "string_value", + "easeInDuration": "string_value", + "easeOutDuration": "string_value", + "timeScale": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-clip-set-timing --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-clip-set-timing --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `clipIndex` | `integer` | Yes | Zero-based index of the clip on its track. | +| `trackName` | `string` | No | Name of the track holding the clip. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `start` | `any` | No | Optional new start time in seconds. | +| `duration` | `any` | No | Optional new duration in seconds. | +| `clipIn` | `any` | No | Optional clip-in (trim offset into the source asset) in seconds. | +| `blendInDuration` | `any` | No | Optional blend-in (crossfade) duration in seconds. | +| `blendOutDuration` | `any` | No | Optional blend-out (crossfade) duration in seconds. | +| `easeInDuration` | `any` | No | Optional ease-in (fade) duration in seconds. | +| `easeOutDuration` | `any` | No | Optional ease-out (fade) duration in seconds. | +| `timeScale` | `any` | No | Optional playback time scale of the clip. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "clipIndex": { + "type": "integer" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "start": { + "$ref": "#/$defs/System.Double" + }, + "duration": { + "$ref": "#/$defs/System.Double" + }, + "clipIn": { + "$ref": "#/$defs/System.Double" + }, + "blendInDuration": { + "$ref": "#/$defs/System.Double" + }, + "blendOutDuration": { + "$ref": "#/$defs/System.Double" + }, + "easeInDuration": { + "$ref": "#/$defs/System.Double" + }, + "easeOutDuration": { + "$ref": "#/$defs/System.Double" + }, + "timeScale": { + "$ref": "#/$defs/System.Double" + } + }, + "$defs": { + "System.Double": { + "type": "number" + } + }, + "required": [ + "assetPath", + "clipIndex" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipTimingResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipTimingResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the track holding the clip." + }, + "clipIndex": { + "type": "integer", + "description": "Index of the clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Resulting start time in seconds." + }, + "duration": { + "type": "number", + "description": "Resulting duration in seconds." + }, + "end": { + "type": "number", + "description": "Resulting end time in seconds." + }, + "clipIn": { + "type": "number", + "description": "Resulting clip-in (trim) in seconds." + }, + "blendInDuration": { + "type": "number", + "description": "Resulting blend-in duration in seconds." + }, + "blendOutDuration": { + "type": "number", + "description": "Resulting blend-out duration in seconds." + }, + "timeScale": { + "type": "number", + "description": "Resulting time scale of the clip." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "clipIndex", + "start", + "duration", + "end", + "clipIn", + "blendInDuration", + "blendOutDuration", + "timeScale", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-create/SKILL.md b/.gemini/skills/timeline-create/SKILL.md new file mode 100644 index 0000000..b1f989c --- /dev/null +++ b/.gemini/skills/timeline-create/SKILL.md @@ -0,0 +1,134 @@ +--- +name: timeline-create +description: Create a new empty `TimelineAsset` (.playable) at a project path. Optionally set the frame rate and a fixed duration mode. Returns the created asset path and GUID. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Create TimelineAsset + +Create a new `TimelineAsset` and save it to disk at an `Assets/`-rooted `.playable` path. A `TimelineAsset` is the authoring container holding tracks, clips, and markers for a cutscene or sequence; a scene `PlayableDirector` plays it. + +## Inputs + +- `assetPath` — required `Assets/...`-rooted path ending in `.playable`. Missing folders are created. +- `frameRate` — optional editor frame rate of the timeline (default 60). +- `durationMode` — optional `BasedOnClips` (default) or `FixedLength`. +- `fixedDuration` — optional duration in seconds, used when `durationMode` is `FixedLength`. + +## Behavior + +Creates the intermediate folders, instantiates a `TimelineAsset`, applies the editor settings, writes it via `AssetDatabase.CreateAsset`, saves, and returns the path + GUID. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-create --input '{ + "assetPath": "string_value", + "frameRate": 0, + "durationMode": "string_value", + "fixedDuration": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-create --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-create --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path ending in '.playable' (e.g. 'Assets/Timelines/Intro.playable'). | +| `frameRate` | `number` | No | Editor frame rate of the timeline (default 60). | +| `durationMode` | `string` | No | Duration mode: 'BasedOnClips' (default) or 'FixedLength'. | +| `fixedDuration` | `number` | No | Fixed duration in seconds, used only when durationMode is 'FixedLength'. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "frameRate": { + "type": "number" + }, + "durationMode": { + "type": "string" + }, + "fixedDuration": { + "type": "number" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-CreateResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-CreateResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the created TimelineAsset." + }, + "guid": { + "type": "string", + "description": "GUID of the created asset." + }, + "frameRate": { + "type": "number", + "description": "Resolved editor frame rate of the timeline." + }, + "durationMode": { + "type": "string", + "description": "Resolved duration mode." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "frameRate", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-director-bind/SKILL.md b/.gemini/skills/timeline-director-bind/SKILL.md new file mode 100644 index 0000000..0d5c799 --- /dev/null +++ b/.gemini/skills/timeline-director-bind/SKILL.md @@ -0,0 +1,241 @@ +--- +name: timeline-director-bind +description: Bind a `TimelineAsset` to a scene GameObject's `PlayableDirector` (adding the component if missing). Optionally set the play-on-awake flag. Returns the director's GameObject and instanceId. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Bind PlayableDirector + +Assign a `TimelineAsset` as the playable of a scene `PlayableDirector` so the timeline can be played at runtime/in the editor. If the GameObject has no `PlayableDirector`, one is added. + +## Inputs + +- `gameObjectRef` — the scene GameObject to host/own the `PlayableDirector` (required). +- `assetPath` — the `.playable` TimelineAsset to bind (required). +- `playOnAwake` — optional flag to set `PlayableDirector.playOnAwake`. + +## Behavior + +Resolves the GameObject, ensures a `PlayableDirector`, sets `playableAsset` to the loaded `TimelineAsset`, applies `playOnAwake` when provided, marks the scene dirty, and returns the director GameObject reference + instanceId. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-director-bind --input '{ + "gameObjectRef": "string_value", + "assetPath": "string_value", + "playOnAwake": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-director-bind --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-director-bind --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `gameObjectRef` | `any` | Yes | Reference to the scene GameObject that should own the PlayableDirector. | +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable) to bind. | +| `playOnAwake` | `any` | No | Optional value for PlayableDirector.playOnAwake. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "assetPath": { + "type": "string" + }, + "playOnAwake": { + "$ref": "#/$defs/System.Boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "System.Boolean": { + "type": "boolean" + } + }, + "required": [ + "gameObjectRef", + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-DirectorBindResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.ComponentRef": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1." + }, + "typeName": { + "type": "string", + "description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null." + }, + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'." + } + }, + "required": [ + "index", + "instanceID" + ], + "description": "Component reference. Used to find a Component at GameObject." + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-DirectorBindResponse": { + "type": "object", + "properties": { + "gameObjectRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the PlayableDirector." + }, + "directorRef": { + "$ref": "#/$defs/AIGD.ComponentRef", + "description": "Reference to the PlayableDirector component." + }, + "instanceId": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "Instance id of the director GameObject." + }, + "assetPath": { + "type": "string", + "description": "Project path of the bound TimelineAsset." + }, + "playOnAwake": { + "type": "boolean", + "description": "Resulting playOnAwake flag." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "instanceId", + "playOnAwake", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-get/SKILL.md b/.gemini/skills/timeline-get/SKILL.md new file mode 100644 index 0000000..c81a7d8 --- /dev/null +++ b/.gemini/skills/timeline-get/SKILL.md @@ -0,0 +1,173 @@ +--- +name: timeline-get +description: "Generic read: serialize a Timeline object via ReflectorNet — the `TimelineAsset` itself, a `TrackAsset` (by name/index), or a clip's `PlayableAsset` (track + clipIndex). Pair with 'timeline-modify' to write changes back. Read-only." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Get Object + +Serialize a Timeline object via ReflectorNet. This is the generic escape hatch for fields not covered by the dedicated tools (e.g. an `AnimationPlayableAsset`'s settings or a track's mixer properties). + +## Inputs + +- `assetPath` — required `.playable` TimelineAsset path. +- `trackName` / `trackIndex` — when set, target a track instead of the whole asset. +- `clipIndex` — when >= 0 (and a track is selected), target that clip's `PlayableAsset`. +- `deepSerialization` — when `true`, recurse through nested objects. + +## Behavior + +Resolves the target object (asset / track / clip asset), serializes it via ReflectorNet, and returns the serialized member plus the resolved type name. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-get --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "clipIndex": 0, + "deepSerialization": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-get --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-get --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Optional track name to target a track instead of the asset. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and a track target is wanted (-1 = asset only). | +| `clipIndex` | `integer` | No | Clip index to target that clip's PlayableAsset (-1 = the track/asset itself). | +| `deepSerialization` | `boolean` | No | Performs deep serialization including nested objects. Otherwise only top-level members. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "clipIndex": { + "type": "integer" + }, + "deepSerialization": { + "type": "boolean" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineGetResponse" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineGetResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "targetKind": { + "type": "string", + "description": "Kind of the serialized target: TimelineAsset, TrackAsset, or ClipAsset." + }, + "targetType": { + "type": "string", + "description": "Full type name of the serialized target." + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Serialized target data." + } + } + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-list/SKILL.md b/.gemini/skills/timeline-list/SKILL.md new file mode 100644 index 0000000..641a1c6 --- /dev/null +++ b/.gemini/skills/timeline-list/SKILL.md @@ -0,0 +1,131 @@ +--- +name: timeline-list +description: List every `TimelineAsset` in the project with its path, GUID, track count and duration. Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / List TimelineAssets + +Search the project AssetDatabase for `TimelineAsset` (.playable) assets and report each one's path, GUID, track count, and computed duration. + +## Inputs + +- `includeTrackCount` (bool, default true) — when true, load each asset to count its output tracks; when false, skip loading (faster, no counts). + +## Behavior + +Runs `AssetDatabase.FindAssets("t:TimelineAsset")`, resolves each to a path, and (optionally) loads it for track count + duration. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-list --input '{ + "includeTrackCount": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `includeTrackCount` | `boolean` | No | If true (default), load each asset to report its track count and duration; if false, skip loading. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "includeTrackCount": { + "type": "boolean" + } + } +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "guid": { + "type": "string", + "description": "Asset GUID." + }, + "trackCount": { + "type": "integer", + "description": "Number of output tracks (0 when includeTrackCount is false)." + }, + "duration": { + "type": "number", + "description": "Computed duration in seconds (0 when includeTrackCount is false)." + } + }, + "required": [ + "trackCount", + "duration" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of TimelineAssets found." + }, + "timelines": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ListItem-1", + "description": "The TimelineAssets in the project." + } + }, + "required": [ + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-marker-add/SKILL.md b/.gemini/skills/timeline-marker-add/SKILL.md new file mode 100644 index 0000000..a44b1a7 --- /dev/null +++ b/.gemini/skills/timeline-marker-add/SKILL.md @@ -0,0 +1,152 @@ +--- +name: timeline-marker-add +description: Add a marker at a time on a track (or the timeline marker track). `markerType` accepts 'Signal' (a SignalEmitter, default) or a full IMarker/ScriptableObject marker type name. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Marker + +Add a marker at a given time. By default a `SignalEmitter` is created (the standard Timeline signal marker). A full marker type name can be supplied to create a custom marker. The marker is placed on the named track, or on the timeline's marker track when no track is given. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `time` — required marker time in seconds. +- `markerType` — 'Signal' (default) or a full marker type name (must implement `IMarker`). +- `trackName` — optional track to host the marker; when null, the timeline's marker track is used. +- `trackIndex` — root-track index used when `trackName` is null AND `useMarkerTrack` is false. +- `useMarkerTrack` — when true (default), null trackName means the timeline marker track; when false, the marker is placed on the track at `trackIndex`. + +## Behavior + +Resolves the marker holder (a `TrackAsset` or the timeline's marker track), creates the marker via `CreateMarker`, sets its time, saves the asset, and returns the marker type and time. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-marker-add --input '{ + "assetPath": "string_value", + "time": 0, + "markerType": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "useMarkerTrack": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-marker-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-marker-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `time` | `number` | Yes | Marker time in seconds. | +| `markerType` | `string` | No | Marker type: 'Signal' (default) or a full marker type name implementing IMarker. | +| `trackName` | `string` | No | Optional track to host the marker. Takes precedence over the marker-track / index logic. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and useMarkerTrack is false. | +| `useMarkerTrack` | `boolean` | No | When true (default), a null trackName targets the timeline's marker track; when false, the track at trackIndex. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "time": { + "type": "number" + }, + "markerType": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "useMarkerTrack": { + "type": "boolean" + } + }, + "required": [ + "assetPath", + "time" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-MarkerAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-MarkerAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "holderTrackName": { + "type": "string", + "description": "Name of the track (or marker track) the marker was placed on." + }, + "markerType": { + "type": "string", + "description": "Type name of the created marker." + }, + "time": { + "type": "number", + "description": "Marker time in seconds." + }, + "markerCountOnHolder": { + "type": "integer", + "description": "Number of markers on the holding track after adding." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "time", + "markerCountOnHolder", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-modify/SKILL.md b/.gemini/skills/timeline-modify/SKILL.md new file mode 100644 index 0000000..6240b38 --- /dev/null +++ b/.gemini/skills/timeline-modify/SKILL.md @@ -0,0 +1,189 @@ +--- +name: timeline-modify +description: "Generic write: apply a `SerializedMember` diff to a Timeline object (the `TimelineAsset`, a `TrackAsset`, or a clip's `PlayableAsset`) via ReflectorNet `TryModify`. Use 'timeline-get' first to inspect the structure. Remember: object *fields* must be supplied through the `fields` channel and *properties* through `props` — there is no cross-fallback." +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Modify Object + +Modify a Timeline object by applying a `SerializedMember` diff via ReflectorNet. This is the generic escape hatch for members not covered by the dedicated tools. + +## Inputs + +- `assetPath` — required `.playable` TimelineAsset path. +- `data` — the `SerializedMember` diff to apply. Put C# *fields* in the `fields` array and *properties* in the `props` array; ReflectorNet resolves them on separate channels with no fallback. +- `trackName` / `trackIndex` — when set, target a track instead of the whole asset. +- `clipIndex` — when >= 0 (and a track is selected), target that clip's `PlayableAsset`. + +## Behavior + +Resolves the target, applies the diff via `Reflector.TryModify`, and on success marks the asset dirty and saves. The applied logs are returned. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-modify --input '{ + "assetPath": "string_value", + "data": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "clipIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-modify --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-modify --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `data` | `any` | Yes | The SerializedMember diff to apply. Fields go in 'fields', properties in 'props'. | +| `trackName` | `string` | No | Optional track name to target a track instead of the asset. | +| `trackIndex` | `integer` | No | Root-track index used when trackName is null and a track target is wanted (-1 = asset only). | +| `clipIndex` | `integer` | No | Clip index to target that clip's PlayableAsset (-1 = the track/asset itself). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "data": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "clipIndex": { + "type": "integer" + } + }, + "$defs": { + "com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember" + } + }, + "com.IvanMurzak.ReflectorNet.Model.SerializedMember": { + "type": "object", + "properties": { + "typeName": { + "type": "string", + "description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc." + }, + "name": { + "type": "string", + "description": "Object name." + }, + "value": { + "description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested field value." + }, + "description": "Fields of the object, serialized as a list of 'SerializedMember'." + }, + "props": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember", + "description": "Nested property value." + }, + "description": "Properties of the object, serialized as a list of 'SerializedMember'." + } + }, + "required": [ + "typeName" + ], + "additionalProperties": false + } + }, + "required": [ + "assetPath", + "data" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineModifyResponse" + } + }, + "$defs": { + "System.String-1": { + "type": "array", + "items": { + "type": "string" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TimelineModifyResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the modification was successful." + }, + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "targetKind": { + "type": "string", + "description": "Kind of the modified target: TimelineAsset, TrackAsset, or ClipAsset." + }, + "targetType": { + "type": "string", + "description": "Full type name of the modified target." + }, + "logs": { + "$ref": "#/$defs/System.String-1", + "description": "Log of modifications and any warnings/errors." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-track-add/SKILL.md b/.gemini/skills/timeline-track-add/SKILL.md new file mode 100644 index 0000000..fd8f476 --- /dev/null +++ b/.gemini/skills/timeline-track-add/SKILL.md @@ -0,0 +1,139 @@ +--- +name: timeline-track-add +description: Add a track to a `TimelineAsset`. `trackType` accepts a kind keyword (Animation, Activation, Audio, Signal, Control, Playable, Group) or a full TrackAsset type name. Optionally nest the new track under an existing GroupTrack. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Add Track + +Add a new track to a `TimelineAsset`. Tracks are the lanes a timeline plays: an `AnimationTrack` drives an Animator, an `ActivationTrack` toggles a GameObject active, an `AudioTrack` plays clips, a `SignalTrack` emits signals, a `ControlTrack` drives nested directors/particles, and a `GroupTrack` organizes other tracks. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackType` — required kind keyword or full TrackAsset type name. +- `trackName` — optional display name for the new track. +- `parentGroupName` — optional name of an existing GroupTrack to nest the new track under. + +## Behavior + +Resolves the track type, creates the track via `TimelineAsset.CreateTrack`, parents it under the named group when provided, saves the asset, and returns the new track's name, type and root index. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-add --input '{ + "assetPath": "string_value", + "trackType": "string_value", + "trackName": "string_value", + "parentGroupName": "string_value" +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-add --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-add --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackType` | `string` | Yes | Track kind keyword (Animation/Activation/Audio/Signal/Control/Playable/Group) or full TrackAsset type name. | +| `trackName` | `string` | No | Optional display name for the new track. | +| `parentGroupName` | `string` | No | Optional name of an existing GroupTrack to nest the new track under. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackType": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "parentGroupName": { + "type": "string" + } + }, + "required": [ + "assetPath", + "trackType" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackAddResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackAddResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "trackName": { + "type": "string", + "description": "Name of the created track." + }, + "trackType": { + "type": "string", + "description": "Type name of the created track." + }, + "rootIndex": { + "type": "integer", + "description": "Index of the track among the root tracks (-1 if nested under a group)." + }, + "parentGroup": { + "type": "string", + "description": "Name of the parent GroupTrack, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "rootIndex", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-track-bind/SKILL.md b/.gemini/skills/timeline-track-bind/SKILL.md new file mode 100644 index 0000000..f2c5291 --- /dev/null +++ b/.gemini/skills/timeline-track-bind/SKILL.md @@ -0,0 +1,220 @@ +--- +name: timeline-track-bind +description: Bind a scene object to a Timeline output track via a `PlayableDirector` generic binding — e.g. point an AnimationTrack at an `Animator`, or an ActivationTrack at a GameObject. The director must already play the timeline that owns the track. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Bind Track + +Set the scene-object binding for a specific output track on a `PlayableDirector`. The director's `playableAsset` must be the `TimelineAsset` that owns the track. For an `AnimationTrack` the binding is typically an `Animator`; for an `ActivationTrack`/`AudioTrack` it is the GameObject / AudioSource that the track drives. + +## Inputs + +- `directorRef` — GameObject hosting the `PlayableDirector` that plays the timeline (required). +- `trackName` / `trackIndex` — which output track to bind (name wins; index default 0). +- `targetRef` — the scene GameObject to bind to the track. When the track expects a `Component` (e.g. Animator/AudioSource), the matching component on this GameObject is used; otherwise the GameObject itself is bound. +- `clearBinding` — when true, clears the binding instead of setting it (ignored if `targetRef` is given). + +## Behavior + +Resolves the director and its timeline, finds the track, computes the binding object (component when the track output type is a Component, else the GameObject), calls `SetGenericBinding`, marks the scene dirty, and returns the bound object's name. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-bind --input '{ + "directorRef": "string_value", + "trackName": "string_value", + "trackIndex": 0, + "targetRef": "string_value", + "clearBinding": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-bind --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-bind --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `directorRef` | `any` | Yes | Reference to the GameObject hosting the PlayableDirector that plays the timeline. | +| `trackName` | `string` | No | Name of the output track to bind. Takes precedence over trackIndex. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | +| `targetRef` | `any` | No | Scene GameObject to bind to the track (its matching component is used when the track expects one). | +| `clearBinding` | `boolean` | No | If true, clears the track binding (ignored when targetRef is provided). | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "directorRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + }, + "targetRef": { + "$ref": "#/$defs/AIGD.GameObjectRef" + }, + "clearBinding": { + "type": "boolean" + } + }, + "$defs": { + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + } + }, + "required": [ + "directorRef" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackBindResponse" + } + }, + "$defs": { + "AIGD.GameObjectRef": { + "type": "object", + "properties": { + "instanceID": { + "$ref": "#/$defs/UnityEngine.EntityId", + "description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)" + }, + "path": { + "type": "string", + "description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2." + }, + "name": { + "type": "string", + "description": "Name of a GameObject in hierarchy. Priority: 3." + }, + "assetType": { + "$ref": "#/$defs/System.Type", + "description": "Type of the asset." + }, + "assetPath": { + "type": "string", + "description": "Path to the asset within the project. Starts with 'Assets/'" + }, + "assetGuid": { + "type": "string", + "description": "Unique identifier for the asset." + } + }, + "required": [ + "instanceID" + ], + "description": "Find GameObject in opened Prefab or in the active Scene." + }, + "UnityEngine.EntityId": { + "type": "string", + "pattern": "^[0-9]+$" + }, + "System.Type": { + "type": "string" + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackBindResponse": { + "type": "object", + "properties": { + "directorRef": { + "$ref": "#/$defs/AIGD.GameObjectRef", + "description": "Reference to the GameObject hosting the PlayableDirector." + }, + "trackName": { + "type": "string", + "description": "Name of the bound track." + }, + "boundTo": { + "type": "string", + "description": "Name of the bound object, or null when cleared." + }, + "boundType": { + "type": "string", + "description": "Type name of the bound object, or null." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-track-list/SKILL.md b/.gemini/skills/timeline-track-list/SKILL.md new file mode 100644 index 0000000..b6bead2 --- /dev/null +++ b/.gemini/skills/timeline-track-list/SKILL.md @@ -0,0 +1,223 @@ +--- +name: timeline-track-list +description: List the tracks of a `TimelineAsset` — name, type, mute/lock state, clip count, and each track's clips (with timing). Read-only. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / List Tracks + +List the tracks of a `TimelineAsset`. For each output track returns its name, type, muted / locked flags, clip count, and (optionally) the clips with their timing. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `includeClips` — when `true` (default) include each track's clip list; when `false`, counts only. + +## Behavior + +Enumerates `TimelineAsset.GetOutputTracks()` and reports each track. Read-only. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-list --input '{ + "assetPath": "string_value", + "includeClips": false +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-list --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-list --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `includeClips` | `boolean` | No | If true (default), include each track's clips and their timing; if false, only counts. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "includeClips": { + "type": "boolean" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackListResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Track name." + }, + "trackType": { + "type": "string", + "description": "Track type name." + }, + "isRoot": { + "type": "boolean", + "description": "Whether the track is a root (top-level) track." + }, + "rootIndex": { + "type": "integer", + "description": "Root-track index, or -1 when nested in a group." + }, + "muted": { + "type": "boolean", + "description": "Whether the track is muted." + }, + "locked": { + "type": "boolean", + "description": "Whether the track is locked." + }, + "clipCount": { + "type": "integer", + "description": "Number of clips on the track." + }, + "clips": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo-1", + "description": "The clips on the track (empty when includeClips is false)." + } + }, + "required": [ + "isRoot", + "rootIndex", + "muted", + "locked", + "clipCount" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo-1": { + "type": "array", + "items": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo" + } + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-ClipInfo": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "Zero-based index of the clip on its track." + }, + "displayName": { + "type": "string", + "description": "Display name of the clip." + }, + "start": { + "type": "number", + "description": "Clip start time in seconds." + }, + "duration": { + "type": "number", + "description": "Clip duration in seconds." + }, + "end": { + "type": "number", + "description": "Clip end time in seconds." + }, + "blendInDuration": { + "type": "number", + "description": "Blend-in duration in seconds." + }, + "blendOutDuration": { + "type": "number", + "description": "Blend-out duration in seconds." + }, + "assetType": { + "type": "string", + "description": "Type name of the clip's PlayableAsset, or null." + } + }, + "required": [ + "index", + "start", + "duration", + "end", + "blendInDuration", + "blendOutDuration" + ] + }, + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackListResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "durationMode": { + "type": "string", + "description": "Duration mode of the timeline." + }, + "duration": { + "type": "number", + "description": "Computed duration of the timeline in seconds." + }, + "count": { + "type": "integer", + "description": "Number of output tracks." + }, + "tracks": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackInfo-1", + "description": "The output tracks of the timeline." + } + }, + "required": [ + "duration", + "count" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/.gemini/skills/timeline-track-remove/SKILL.md b/.gemini/skills/timeline-track-remove/SKILL.md new file mode 100644 index 0000000..2c9fae4 --- /dev/null +++ b/.gemini/skills/timeline-track-remove/SKILL.md @@ -0,0 +1,128 @@ +--- +name: timeline-track-remove +description: Remove a root track (and its clips/markers) from a `TimelineAsset`, identified by `trackName` or by `trackIndex`. Destructive. +metadata: + generated-by: mcp-plugin-dotnet +--- + +# Timeline / Remove Track + +Remove a track from a `TimelineAsset`. The track is identified by name (preferred) or by its root index. All clips and markers on the track are deleted with it. + +## Inputs + +- `assetPath` — required path to the `.playable` TimelineAsset. +- `trackName` — name of the track to remove. When provided, takes precedence over `trackIndex`. +- `trackIndex` — zero-based root-track index used when `trackName` is null/empty (default 0). + +## Behavior + +Resolves the track, deletes it via `TimelineAsset.DeleteTrack`, saves the asset, and returns the remaining track count. Destructive. Runs on the Unity main thread. + +## How to Call + +```bash +unity-mcp-cli run-tool timeline-track-remove --input '{ + "assetPath": "string_value", + "trackName": "string_value", + "trackIndex": 0 +}' +``` + +> For complex input (multi-line strings, code), save the JSON to a file and use: +> ```bash +> unity-mcp-cli run-tool timeline-track-remove --input-file args.json +> ``` +> +> Or pipe via stdin (recommended): +> ```bash +> unity-mcp-cli run-tool timeline-track-remove --input-file - <<'EOF' +> {"param": "value"} +> EOF +> ``` + + +### Troubleshooting + +If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead. +Read the /unity-initial-setup skill for detailed installation instructions. + +## Input + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| `assetPath` | `string` | Yes | Assets-rooted path to the TimelineAsset (.playable). | +| `trackName` | `string` | No | Name of the track to remove. Takes precedence over trackIndex when provided. | +| `trackIndex` | `integer` | No | Zero-based root-track index, used when trackName is null/empty. | + +### Input JSON Schema + +```json +{ + "type": "object", + "properties": { + "assetPath": { + "type": "string" + }, + "trackName": { + "type": "string" + }, + "trackIndex": { + "type": "integer" + } + }, + "required": [ + "assetPath" + ] +} +``` + +## Output + +### Output JSON Schema + +```json +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackRemoveResponse" + } + }, + "$defs": { + "com.IvanMurzak.Unity.MCP.Editor.API.Tool_Timeline-TrackRemoveResponse": { + "type": "object", + "properties": { + "assetPath": { + "type": "string", + "description": "Project path of the TimelineAsset." + }, + "removedTrackName": { + "type": "string", + "description": "Name of the removed track." + }, + "removedTrackType": { + "type": "string", + "description": "Type name of the removed track." + }, + "remainingRootTrackCount": { + "type": "integer", + "description": "Number of root tracks remaining after removal." + }, + "success": { + "type": "boolean", + "description": "Whether the operation succeeded." + } + }, + "required": [ + "remainingRootTrackCount", + "success" + ] + } + }, + "required": [ + "result" + ] +} +``` + diff --git a/Packages/manifest.json b/Packages/manifest.json index dcdce7a..9e9da75 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -49,7 +49,14 @@ "com.ivanmurzak.unity.mcp": "0.93.2", "com.ivanmurzak.unity.mcp.animation": "1.2.34", "com.ivanmurzak.unity.mcp.cinemachine": "1.0.19", - "com.ivanmurzak.unity.mcp.inputsystem": "1.0.19" + "com.ivanmurzak.unity.mcp.inputsystem": "1.0.19", + "com.ivanmurzak.unity.mcp.navigation": "1.0.19", + "com.ivanmurzak.unity.mcp.particlesystem": "1.2.33", + "com.ivanmurzak.unity.mcp.probuilder": "1.2.33", + "com.ivanmurzak.unity.mcp.splines": "1.0.18", + "com.ivanmurzak.unity.mcp.terrain": "1.0.19", + "com.ivanmurzak.unity.mcp.tilemap": "1.0.18", + "com.ivanmurzak.unity.mcp.timeline": "1.0.19" }, "scopedRegistries": [ { diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 625ddde..df4bb2e 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -41,6 +41,98 @@ }, "url": "https://package.openupm.com" }, + "com.ivanmurzak.unity.mcp.navigation": { + "version": "1.0.19", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.ai.navigation": "1.1.7" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.particlesystem": { + "version": "1.2.33", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.probuilder": { + "version": "1.2.33", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.probuilder": "5.2.4" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.splines": { + "version": "1.0.18", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.splines": "2.8.4" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.terrain": { + "version": "1.0.19", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.tilemap": { + "version": "1.0.18", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.2d.tilemap.extras": "3.1.3" + }, + "url": "https://package.openupm.com" + }, + "com.ivanmurzak.unity.mcp.timeline": { + "version": "1.0.19", + "depth": 0, + "source": "registry", + "dependencies": { + "com.ivanmurzak.unity.mcp": "0.93.2", + "com.unity.timeline": "1.8.12" + }, + "url": "https://package.openupm.com" + }, + "com.unity.2d.tilemap": { + "version": "1.0.0", + "depth": 2, + "source": "builtin", + "dependencies": { + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.uielements": "1.0.0" + } + }, + "com.unity.2d.tilemap.extras": { + "version": "9.0.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.2d.tilemap": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.ai.navigation": { "version": "2.0.14", "depth": 0, @@ -124,7 +216,7 @@ }, "com.unity.mathematics": { "version": "1.4.0", - "depth": 3, + "depth": 2, "source": "builtin", "dependencies": {} }, @@ -135,6 +227,18 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.probuilder": { + "version": "6.1.2", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.shadergraph": "17.0.3", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.settings-manager": "1.0.3" + }, + "url": "https://packages.unity.com" + }, "com.unity.profiling.core": { "version": "1.0.3", "depth": 2, @@ -180,7 +284,7 @@ }, "com.unity.settings-manager": { "version": "2.1.1", - "depth": 3, + "depth": 2, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" @@ -197,7 +301,7 @@ }, "com.unity.splines": { "version": "2.9.0", - "depth": 2, + "depth": 1, "source": "registry", "dependencies": { "com.unity.mathematics": "1.2.1", diff --git a/ProjectSettings/Packages/com.unity.probuilder/Settings.json b/ProjectSettings/Packages/com.unity.probuilder/Settings.json new file mode 100644 index 0000000..c308320 --- /dev/null +++ b/ProjectSettings/Packages/com.unity.probuilder/Settings.json @@ -0,0 +1,41 @@ +{ + "m_Dictionary": { + "m_DictionaryValues": [ + { + "type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "s_SelectMode", + "value": "{\"m_Value\":4}" + }, + { + "type": "UnityEngine.ProBuilder.LogLevel, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.level", + "value": "{\"m_Value\":3}" + }, + { + "type": "UnityEngine.ProBuilder.LogOutput, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.output", + "value": "{\"m_Value\":1}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "log.path", + "value": "{\"m_Value\":\"ProBuilderLog.txt\"}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "about.identifier", + "value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":1,\"m_Patch\":2,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "preferences.version", + "value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":1,\"m_Patch\":2,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "editor.backFaceSelectEnabled", + "value": "{\"m_Value\":false}" + } + ] + } +} \ No newline at end of file