@alpsckr/unitycli 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/command-contract.json +591 -591
- package/contracts/package-files.json +367 -367
- package/contracts/stable-session/direct-call-semantics.json +3 -3
- package/contracts/stable-session/request-digest-v1-golden.json +2 -2
- package/contracts/tool-completion-contract.json +322 -322
- package/dist/bridge/domains/animation.js +37 -37
- package/dist/bridge/domains/animation.js.map +1 -1
- package/dist/bridge/domains/asset.js +15 -16
- package/dist/bridge/domains/asset.js.map +1 -1
- package/dist/bridge/domains/build.js +13 -13
- package/dist/bridge/domains/build.js.map +1 -1
- package/dist/bridge/domains/camera.js +7 -7
- package/dist/bridge/domains/camera.js.map +1 -1
- package/dist/bridge/domains/catalog-editor.d.ts +2 -0
- package/dist/bridge/domains/{project-tool.js → catalog-editor.js} +10 -10
- package/dist/bridge/domains/catalog-editor.js.map +1 -0
- package/dist/bridge/domains/catalog-player.d.ts +2 -0
- package/dist/bridge/domains/{runtime-tool.js → catalog-player.js} +9 -9
- package/dist/bridge/domains/catalog-player.js.map +1 -0
- package/dist/bridge/domains/code.js +1 -1
- package/dist/bridge/domains/code.js.map +1 -1
- package/dist/bridge/domains/console.js +2 -2
- package/dist/bridge/domains/console.js.map +1 -1
- package/dist/bridge/domains/doctor.js +3 -3
- package/dist/bridge/domains/doctor.js.map +1 -1
- package/dist/bridge/domains/editor.js +14 -14
- package/dist/bridge/domains/editor.js.map +1 -1
- package/dist/bridge/domains/game-object.js +16 -16
- package/dist/bridge/domains/game-object.js.map +1 -1
- package/dist/bridge/domains/lighting.d.ts +2 -0
- package/dist/bridge/domains/lighting.js +127 -0
- package/dist/bridge/domains/lighting.js.map +1 -0
- package/dist/bridge/domains/material.js +5 -5
- package/dist/bridge/domains/material.js.map +1 -1
- package/dist/bridge/domains/navmesh.js +3 -3
- package/dist/bridge/domains/navmesh.js.map +1 -1
- package/dist/bridge/domains/occlusion.js +1 -9
- package/dist/bridge/domains/occlusion.js.map +1 -1
- package/dist/bridge/domains/physics.js +14 -14
- package/dist/bridge/domains/physics.js.map +1 -1
- package/dist/bridge/domains/prefab.js +12 -12
- package/dist/bridge/domains/prefab.js.map +1 -1
- package/dist/bridge/domains/profiler.js +25 -25
- package/dist/bridge/domains/profiler.js.map +1 -1
- package/dist/bridge/domains/rendering.d.ts +2 -0
- package/dist/bridge/domains/rendering.js +71 -0
- package/dist/bridge/domains/rendering.js.map +1 -0
- package/dist/bridge/domains/runtime-reflection.d.ts +2 -0
- package/dist/bridge/domains/{reflection.js → runtime-reflection.js} +7 -7
- package/dist/bridge/domains/runtime-reflection.js.map +1 -0
- package/dist/bridge/domains/scene.js +15 -15
- package/dist/bridge/domains/scene.js.map +1 -1
- package/dist/bridge/domains/screenshot.js +6 -6
- package/dist/bridge/domains/screenshot.js.map +1 -1
- package/dist/bridge/domains/scriptable-object.js +4 -4
- package/dist/bridge/domains/scriptable-object.js.map +1 -1
- package/dist/bridge/domains/serialized-object.d.ts +2 -0
- package/dist/bridge/domains/{object.js → serialized-object.js} +6 -6
- package/dist/bridge/domains/serialized-object.js.map +1 -0
- package/dist/bridge/domains/shader.js +7 -7
- package/dist/bridge/domains/shader.js.map +1 -1
- package/dist/bridge/domains/texture.js +7 -7
- package/dist/bridge/domains/texture.js.map +1 -1
- package/dist/bridge/domains/timeline.js +4 -4
- package/dist/bridge/domains/timeline.js.map +1 -1
- package/dist/bridge/domains/ui.js +18 -18
- package/dist/bridge/domains/ui.js.map +1 -1
- package/dist/bridge/domains/volume.d.ts +2 -0
- package/dist/bridge/domains/volume.js +26 -0
- package/dist/bridge/domains/volume.js.map +1 -0
- package/dist/bridge/index.js +3 -3
- package/dist/bridge/index.js.map +1 -1
- package/dist/bridge/registry.js +15 -13
- package/dist/bridge/registry.js.map +1 -1
- package/dist/bridge/session-supervisor.js +4 -4
- package/dist/bridge/session-supervisor.js.map +1 -1
- package/dist/bridge/types.d.ts +1 -1
- package/dist/catalog-protocol.js +3 -3
- package/dist/catalog-protocol.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/cinemachine.js +14 -14
- package/dist/extensions/.generated-bridge-domains/cinemachine.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/hdrp.js +7 -7
- package/dist/extensions/.generated-bridge-domains/hdrp.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/probuilder.d.ts +3 -3
- package/dist/extensions/.generated-bridge-domains/probuilder.js +40 -40
- package/dist/extensions/.generated-bridge-domains/probuilder.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/urp.js +12 -12
- package/dist/extensions/.generated-bridge-domains/urp.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/vfx.js +27 -27
- package/dist/extensions/.generated-bridge-domains/vfx.js.map +1 -1
- package/dist/package-manager.js +1 -1
- package/dist/project-tool-discovery.d.ts +1 -1
- package/dist/project-tool-discovery.js +5 -5
- package/dist/project-tool-discovery.js.map +1 -1
- package/dist/runtime-code.js +2 -2
- package/dist/runtime-code.js.map +1 -1
- package/dist/services/reflect-service.d.ts +3 -3
- package/dist/services/reflect-service.js +5 -5
- package/dist/services/reflect-service.js.map +1 -1
- package/dist/tools/.generated-completion-registry.js +689 -689
- package/dist/tools/.generated-completion-registry.js.map +1 -1
- package/dist/tools/.generated-registry.d.ts +12 -12
- package/dist/tools/.generated-registry.js +12 -12
- package/dist/tools/.generated-registry.js.map +1 -1
- package/dist/tools/.generated-schemas.js +13 -13
- package/dist/tools/.generated-schemas.js.map +1 -1
- package/dist/tools/catalog.d.ts +1 -1
- package/dist/tools/catalog.js +1 -1
- package/dist/tools/code/{exec.d.ts → execute.d.ts} +1 -1
- package/dist/tools/code/{exec.js → execute.js} +5 -5
- package/dist/tools/code/execute.js.map +1 -0
- package/dist/tools/dispatcher.js +12 -8
- package/dist/tools/dispatcher.js.map +1 -1
- package/dist/tools/editor/compile.d.ts +3 -2
- package/dist/tools/editor/compile.js +23 -13
- package/dist/tools/editor/compile.js.map +1 -1
- package/dist/tools/editor/play-mode-status.js +2 -2
- package/dist/tools/editor/play-mode-status.js.map +1 -1
- package/dist/tools/editor/refresh.js +2 -2
- package/dist/tools/editor/refresh.js.map +1 -1
- package/dist/tools/metadata/derived.d.ts +0 -7
- package/dist/tools/metadata/derived.js +7 -16
- package/dist/tools/metadata/derived.js.map +1 -1
- package/dist/tools/metadata/index.d.ts +1 -1
- package/dist/tools/metadata/index.js +1 -1
- package/dist/tools/metadata/index.js.map +1 -1
- package/dist/tools/metadata/status.js +1 -1
- package/dist/tools/metadata/status.js.map +1 -1
- package/dist/tools/{runtime → player-runtime}/console.js +4 -4
- package/dist/tools/player-runtime/console.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/input/key.js +4 -4
- package/dist/tools/player-runtime/input/key.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/input/pointer.js +4 -4
- package/dist/tools/player-runtime/input/pointer.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/log.js +5 -5
- package/dist/tools/player-runtime/log.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/state.js +4 -4
- package/dist/tools/player-runtime/state.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/target-framerate/set.js +4 -4
- package/dist/tools/player-runtime/target-framerate/set.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/time-scale/set.js +4 -4
- package/dist/tools/player-runtime/time-scale/set.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/ui/capture-element.js +4 -4
- package/dist/tools/player-runtime/ui/capture-element.js.map +1 -0
- package/dist/tools/tools/group-summaries.js +17 -14
- package/dist/tools/tools/group-summaries.js.map +1 -1
- package/dist/tools/{reflect/member.js → type-inspection/get-member.js} +6 -6
- package/dist/tools/type-inspection/get-member.js.map +1 -0
- package/dist/tools/{reflect/type.js → type-inspection/get-type.js} +6 -6
- package/dist/tools/type-inspection/get-type.js.map +1 -0
- package/dist/tools/{reflect → type-inspection}/search.js +5 -5
- package/dist/tools/type-inspection/search.js.map +1 -0
- package/docs/README.md +1 -2
- package/docs/architecture.md +1 -1
- package/docs/availability-differences.md +2 -2
- package/docs/development.md +1 -1
- package/docs/error-codes.md +5 -5
- package/docs/extensions.md +2 -2
- package/docs/risk-and-side-effects.md +12 -12
- package/docs/safety-boundaries.md +7 -7
- package/docs/tool-discovery.md +1 -1
- package/docs/tool-execution.md +16 -16
- package/extensions/cinemachine/bridge/domains/cinemachine.ts +14 -14
- package/extensions/hdrp/bridge/domains/hdrp.ts +7 -7
- package/extensions/hdrp/unitypkg/Editor/Hdrp/HdrpToolSupport.cs +2 -2
- package/extensions/probuilder/bridge/domains/probuilder.ts +40 -40
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderErrors.cs +1 -1
- package/extensions/urp/bridge/domains/urp.ts +12 -12
- package/extensions/urp/unitypkg/Editor/Urp/UrpToolSupport.cs +2 -2
- package/extensions/vfx-graph/bridge/domains/vfx.ts +27 -27
- package/package.json +1 -1
- package/skills/unitycli/SKILL.md +1 -1
- package/skills/unitycli/manifest.json +1 -1
- package/skills/unitycli/references/operation-protocol.md +1 -1
- package/unitypkg/Editor/Bridge/BridgeHttpServer.cs +2 -2
- package/unitypkg/Editor/Commands/ProjectToolCommands.cs +7 -7
- package/unitypkg/Editor/Commands/RuntimeToolCommands.cs +6 -6
- package/unitypkg/Editor/Generated/UnityCliToolCompletionRegistry.g.cs +147 -147
- package/unitypkg/Editor/Infrastructure/CodeExecSupport.cs +4 -4
- package/unitypkg/Editor/Infrastructure/UnityCliAdmission.cs +17 -17
- package/unitypkg/Editor/Infrastructure/UnityCliCompileCoordinator.cs +61 -54
- package/unitypkg/Editor/Infrastructure/UnityCliJson.cs +0 -18
- package/unitypkg/Editor/Infrastructure/UnityCliLiveRefreshCoordinator.cs +26 -21
- package/unitypkg/Editor/Infrastructure/UnityCliObjectPatch.cs +1 -1
- package/unitypkg/Editor/Infrastructure/UnityCliObjectRef.cs +5 -5
- package/unitypkg/Editor/Infrastructure/UnityCliOperationCoordinator.cs +32 -32
- package/unitypkg/Editor/Infrastructure/UnityCliReflection.cs +12 -12
- package/unitypkg/Editor/Infrastructure/UnityCliRuntimeExecutor.cs +1 -1
- package/unitypkg/Editor/ProjectTools/ProjectToolRegistry.cs +5 -5
- package/unitypkg/Editor/Tools/{animation → animation-clip}/AnimationToolSupport.cs +3 -3
- package/unitypkg/Editor/Tools/{animation/clip → animation-clip}/create.cs +4 -4
- package/unitypkg/Editor/Tools/{animation/clip.cs → animation-clip/read.cs} +3 -3
- package/unitypkg/Editor/Tools/{animation/clip/modify.cs → animation-clip/update.cs} +5 -5
- package/unitypkg/Editor/Tools/{animation/animator → animator}/crossfade.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/get-info.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/get-parameter.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/state.cs → animator/get-state.cs} +3 -3
- package/unitypkg/Editor/Tools/{animation → animator}/play.cs +5 -5
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-enabled.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-parameter.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-speed.cs +1 -1
- package/unitypkg/Editor/Tools/{animation → animator}/stop.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-blend-tree-child.cs +10 -10
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-layer.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-parameter.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-state.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-transition.cs +9 -9
- package/unitypkg/Editor/Tools/{controller → animator-controller}/assign.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-1d.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-2d.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/get-info.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/remove-layer.cs +8 -8
- package/unitypkg/Editor/Tools/{controller → animator-controller}/set-layer-weight.cs +6 -6
- package/unitypkg/Editor/Tools/asset/preview.cs +1 -1
- package/unitypkg/Editor/Tools/asset/{modify.cs → write-text.cs} +6 -6
- package/unitypkg/Editor/Tools/component/get.cs +1 -1
- package/unitypkg/Editor/Tools/component/list-types.cs +2 -2
- package/unitypkg/Editor/Tools/component/modify.cs +1 -1
- package/unitypkg/Editor/Tools/component/set.cs +1 -1
- package/unitypkg/Editor/Tools/console/{get.cs → read.cs} +3 -3
- package/unitypkg/Editor/Tools/editor/{play.cs → play-mode/start.cs} +5 -5
- package/unitypkg/Editor/Tools/editor/{stop.cs → play-mode/stop.cs} +5 -5
- package/unitypkg/Editor/Tools/editor/search.cs +1 -1
- package/unitypkg/Editor/Tools/{go → game-object}/GameObjectToolSupport.cs +5 -22
- package/unitypkg/Editor/Tools/{go → game-object}/create.cs +11 -11
- package/unitypkg/Editor/Tools/{go → game-object}/delete.cs +7 -7
- package/unitypkg/Editor/Tools/{go → game-object}/duplicate.cs +6 -6
- package/unitypkg/Editor/Tools/{go → game-object}/find.cs +5 -5
- package/unitypkg/Editor/Tools/{go → game-object}/look-at.cs +8 -8
- package/unitypkg/Editor/Tools/{go → game-object}/modify.cs +9 -9
- package/unitypkg/Editor/Tools/{go → game-object}/move-relative.cs +7 -7
- package/unitypkg/Editor/Tools/{scene/move-object.cs → game-object/move-to-scene.cs} +7 -7
- package/unitypkg/Editor/Tools/{go → game-object}/set-parent.cs +9 -9
- package/unitypkg/Editor/Tools/{graphics/bake-cancel.cs → lighting/bake/cancel.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/bake-clear.cs → lighting/bake/clear.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/bake-reflection-probe.cs → lighting/bake/reflection-probe.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/bake-settings.cs → lighting/bake/settings.cs} +12 -12
- package/unitypkg/Editor/Tools/{graphics/bake-start.cs → lighting/bake/start.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/bake-status.cs → lighting/bake/status.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics → lighting}/light-probe-group.cs +7 -7
- package/unitypkg/Editor/Tools/{graphics → lighting}/reflection-probe.cs +12 -12
- package/unitypkg/Editor/Tools/{graphics/skybox-get.cs → lighting/skybox/get.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-ambient.cs → lighting/skybox/set-ambient.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-fog.cs → lighting/skybox/set-fog.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-material.cs → lighting/skybox/set-material.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/skybox-set-properties.cs → lighting/skybox/set-properties.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/skybox-set-reflection.cs → lighting/skybox/set-reflection.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-sun.cs → lighting/skybox/set-sun.cs} +5 -5
- package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsToolSupport.cs +5 -5
- package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/info.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/input-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/input-settings.cs +4 -4
- package/unitypkg/Editor/Tools/project-settings/layer/add.cs +3 -0
- package/unitypkg/Editor/Tools/project-settings/layer/remove.cs +3 -0
- package/unitypkg/Editor/Tools/{project → project-settings}/layers.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/player-settings/set.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/player-settings.cs +4 -4
- package/unitypkg/Editor/Tools/project-settings/tag/add.cs +3 -0
- package/unitypkg/Editor/Tools/project-settings/tag/remove.cs +3 -0
- package/unitypkg/Editor/Tools/{project → project-settings}/tags.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/time-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/time-settings.cs +4 -4
- package/unitypkg/Editor/Tools/{graphics → rendering}/GraphicsToolSupport.cs +3 -3
- package/unitypkg/Editor/Tools/rendering/pipeline/info.cs +19 -0
- package/unitypkg/Editor/Tools/{graphics/pipeline-settings.cs → rendering/pipeline/settings.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics → rendering}/quality.cs +17 -17
- package/unitypkg/Editor/Tools/{graphics → rendering}/scene-debug.cs +4 -4
- package/unitypkg/Editor/Tools/rendering/stats.cs +17 -0
- package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/method/find.cs +5 -5
- package/unitypkg/Editor/Tools/{reflection/method/call.cs → runtime-reflection/method/invoke.cs} +7 -7
- package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/type/schema.cs +5 -5
- package/unitypkg/Editor/Tools/scene/gameobject-support.cs +1 -1
- package/unitypkg/Editor/Tools/scene/gameobject.cs +1 -1
- package/unitypkg/Editor/Tools/scene/hierarchy.cs +1 -1
- package/unitypkg/Editor/Tools/{camera/screenshot.cs → screenshot/from-camera.cs} +4 -4
- package/unitypkg/Editor/Tools/{object/modify.cs → serialized-object/patch.cs} +8 -8
- package/unitypkg/Editor/Tools/{object/get-data.cs → serialized-object/read.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/volume.cs → volume/list.cs} +3 -3
- package/unitypkg/Editor/UnityCliBridge.cs +3 -22
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeBridge.cs +15 -15
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeRegistry.cs +1 -1
- package/unitypkg/Runtime/Tools/UnityCliRuntimeTools.cs +22 -22
- package/unitypkg/Shared/UnityCliBridgeQueuePolicy.cs +1 -1
- package/unitypkg/Tests/Editor/UnityCliAdmissionCoordinatorIntegrationTests.cs +7 -7
- package/unitypkg/Tests/Editor/UnityCliBridgeAdmissionIntegrationTests.cs +6 -6
- package/unitypkg/Tests/Editor/UnityCliBridgeQueuePolicyTests.cs +3 -3
- package/unitypkg/Tests/Editor/UnityCliContinuationIntegrationTests.cs +1 -1
- package/unitypkg/Tests/Editor/UnityCliRequestBudgetTests.cs +4 -4
- package/unitypkg/Tests/Editor/UnityCliRuntimeBridgeIntegrationTests.cs +15 -15
- package/unitypkg/Tests/Runtime/UnityCliRuntimeCatalogValidationTests.cs +5 -5
- package/unitypkg/package.json +1 -1
- package/dist/bridge/domains/graphics.d.ts +0 -2
- package/dist/bridge/domains/graphics.js +0 -170
- package/dist/bridge/domains/graphics.js.map +0 -1
- package/dist/bridge/domains/object.d.ts +0 -2
- package/dist/bridge/domains/object.js.map +0 -1
- package/dist/bridge/domains/package.d.ts +0 -2
- package/dist/bridge/domains/package.js +0 -2
- package/dist/bridge/domains/package.js.map +0 -1
- package/dist/bridge/domains/project-tool.d.ts +0 -2
- package/dist/bridge/domains/project-tool.js.map +0 -1
- package/dist/bridge/domains/reflection.d.ts +0 -2
- package/dist/bridge/domains/reflection.js.map +0 -1
- package/dist/bridge/domains/runtime-tool.d.ts +0 -2
- package/dist/bridge/domains/runtime-tool.js.map +0 -1
- package/dist/tools/code/exec.js.map +0 -1
- package/dist/tools/reflect/member.js.map +0 -1
- package/dist/tools/reflect/search.js.map +0 -1
- package/dist/tools/reflect/type.js.map +0 -1
- package/dist/tools/runtime/console.js.map +0 -1
- package/dist/tools/runtime/input/key.js.map +0 -1
- package/dist/tools/runtime/input/pointer.js.map +0 -1
- package/dist/tools/runtime/log.js.map +0 -1
- package/dist/tools/runtime/state.js.map +0 -1
- package/dist/tools/runtime/target-framerate/set.js.map +0 -1
- package/dist/tools/runtime/time-scale/set.js.map +0 -1
- package/dist/tools/runtime/ui/capture-element.js.map +0 -1
- package/unitypkg/Editor/Tools/graphics/pipeline-info.cs +0 -19
- package/unitypkg/Editor/Tools/graphics/stats.cs +0 -17
- package/unitypkg/Editor/Tools/project/layer/add.cs +0 -3
- package/unitypkg/Editor/Tools/project/layer/remove.cs +0 -3
- package/unitypkg/Editor/Tools/project/tag/add.cs +0 -3
- package/unitypkg/Editor/Tools/project/tag/remove.cs +0 -3
- /package/dist/tools/{runtime → player-runtime}/console.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/input/key.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/input/pointer.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/log.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/state.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/target-framerate/set.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/time-scale/set.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/ui/capture-element.d.ts +0 -0
- /package/dist/tools/{reflect/member.d.ts → type-inspection/get-member.d.ts} +0 -0
- /package/dist/tools/{reflect/type.d.ts → type-inspection/get-type.d.ts} +0 -0
- /package/dist/tools/{reflect → type-inspection}/search.d.ts +0 -0
- /package/unitypkg/Editor/Tools/{animation → animator}/AnimatorRuntimeToolSupport.cs +0 -0
- /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsReader.cs +0 -0
- /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectTagLayerToolSupport.cs +0 -0
- /package/unitypkg/Editor/Tools/{object → serialized-object}/ObjectToolSupport.cs +0 -0
|
@@ -242,7 +242,7 @@ namespace UnityCli
|
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
/// <summary>editor.play-mode.status只读取editor.play/editor.stop的direct owner或其已发布终态。</summary>
|
|
245
|
+
/// <summary>editor.play-mode.status只读取editor.play-mode.start/editor.play-mode.stop的direct owner或其已发布终态。</summary>
|
|
246
246
|
private static object ReadEditorPlayModeStatus(string requestId)
|
|
247
247
|
{
|
|
248
248
|
string requestDigest;
|
|
@@ -250,14 +250,14 @@ namespace UnityCli
|
|
|
250
250
|
object terminal;
|
|
251
251
|
if (UnityCliActiveOperation.TryGetTerminalByRequestId(DirectMutationTerminalScope, requestId, out requestDigest, out statusDomain, out terminal))
|
|
252
252
|
{
|
|
253
|
-
if (statusDomain != "editor.play" && statusDomain != "editor.stop")
|
|
253
|
+
if (statusDomain != "editor.play-mode.start" && statusDomain != "editor.play-mode.stop")
|
|
254
254
|
throw new BridgeCommandException("E_REQUEST_NOT_FOUND", "The requested Play Mode operation was not found in this status domain.");
|
|
255
255
|
return UnityCliDurableStatusCoordinator.Terminal(requestId, terminal);
|
|
256
256
|
}
|
|
257
257
|
var root = LoadDirectMutationRoot();
|
|
258
258
|
var toolName = root == null ? null : root.ContainsKey("toolName") ? root["toolName"] as string : null;
|
|
259
259
|
if (root == null || !string.Equals(root["requestId"] as string, requestId, StringComparison.Ordinal)
|
|
260
|
-
|| (toolName != "editor.play" && toolName != "editor.stop"))
|
|
260
|
+
|| (toolName != "editor.play-mode.start" && toolName != "editor.play-mode.stop"))
|
|
261
261
|
throw new BridgeCommandException("E_REQUEST_NOT_FOUND", "The requested Play Mode operation was not found in this Editor session.");
|
|
262
262
|
return UnityCliDurableStatusCoordinator.Running(requestId, root["phase"] as string);
|
|
263
263
|
}
|
|
@@ -270,7 +270,7 @@ namespace UnityCli
|
|
|
270
270
|
&& !string.Equals(root["phase"] as string, "effect_started", StringComparison.Ordinal))
|
|
271
271
|
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Direct mutation active state cannot cross its effect barrier.");
|
|
272
272
|
var toolName = root["toolName"] as string;
|
|
273
|
-
if ((string.Equals(toolName, "editor.play", StringComparison.Ordinal) || string.Equals(toolName, "editor.stop", StringComparison.Ordinal))
|
|
273
|
+
if ((string.Equals(toolName, "editor.play-mode.start", StringComparison.Ordinal) || string.Equals(toolName, "editor.play-mode.stop", StringComparison.Ordinal))
|
|
274
274
|
&& !root.ContainsKey("playModeWasPlaying"))
|
|
275
275
|
root["playModeWasPlaying"] = EditorApplication.isPlaying;
|
|
276
276
|
root["phase"] = "effect_started";
|
|
@@ -376,7 +376,7 @@ namespace UnityCli
|
|
|
376
376
|
catch (BridgeCommandException exception) { return SerializeBridgeExceptionEnvelope(requestId, exception); }
|
|
377
377
|
var toolName = root["toolName"] as string;
|
|
378
378
|
if (string.Equals(phase, "effect_started", StringComparison.Ordinal)
|
|
379
|
-
&& (string.Equals(toolName, "editor.play", StringComparison.Ordinal) || string.Equals(toolName, "editor.stop", StringComparison.Ordinal)))
|
|
379
|
+
&& (string.Equals(toolName, "editor.play-mode.start", StringComparison.Ordinal) || string.Equals(toolName, "editor.play-mode.stop", StringComparison.Ordinal)))
|
|
380
380
|
{
|
|
381
381
|
if (!TryFinalizeRecoveredPlayModeRoot(
|
|
382
382
|
ProductionQueueState, requestId, requestDigest,
|
|
@@ -495,7 +495,7 @@ namespace UnityCli
|
|
|
495
495
|
try { root = LoadDirectMutationRoot(); }
|
|
496
496
|
catch { root = null; }
|
|
497
497
|
var toolName = root == null ? null : root["toolName"] as string;
|
|
498
|
-
if (toolName != "editor.play" && toolName != "editor.stop")
|
|
498
|
+
if (toolName != "editor.play-mode.start" && toolName != "editor.play-mode.stop")
|
|
499
499
|
finalized = TryResumeDirectMutation(requestId, requestDigest) != null;
|
|
500
500
|
}
|
|
501
501
|
if (finalized)
|
|
@@ -542,8 +542,8 @@ namespace UnityCli
|
|
|
542
542
|
catch { return false; }
|
|
543
543
|
if (!string.Equals(root["phase"] as string, "effect_started", StringComparison.Ordinal)) return false;
|
|
544
544
|
var toolName = root["toolName"] as string;
|
|
545
|
-
var enterPlayMode = string.Equals(toolName, "editor.play", StringComparison.Ordinal);
|
|
546
|
-
if (!enterPlayMode && !string.Equals(toolName, "editor.stop", StringComparison.Ordinal)) return false;
|
|
545
|
+
var enterPlayMode = string.Equals(toolName, "editor.play-mode.start", StringComparison.Ordinal);
|
|
546
|
+
if (!enterPlayMode && !string.Equals(toolName, "editor.play-mode.stop", StringComparison.Ordinal)) return false;
|
|
547
547
|
|
|
548
548
|
object beforeValue;
|
|
549
549
|
object deadlineValue;
|
|
@@ -569,8 +569,8 @@ namespace UnityCli
|
|
|
569
569
|
IsPaused = isPaused
|
|
570
570
|
};
|
|
571
571
|
terminal = enterPlayMode
|
|
572
|
-
? (object)new
|
|
573
|
-
: new
|
|
572
|
+
? (object)new EditorPlayModeStartTool.Response { Result = result, State = readState(), PlannedEffects = new List<EditorPlannedEffect> { new EditorPlannedEffect { Type = "editor.play-mode.start" } } }
|
|
573
|
+
: new EditorPlayModeStopTool.Response { Result = result, State = readState(), PlannedEffects = new List<EditorPlannedEffect> { new EditorPlannedEffect { Type = "editor.play-mode.stop" } } };
|
|
574
574
|
PublishDirectMutationTerminal(state, requestId, requestDigest,
|
|
575
575
|
UnityCliSerializer.Serialize(ProtocolEnvelopeFactory.Success(requestId, terminal)));
|
|
576
576
|
}
|
|
@@ -652,7 +652,7 @@ namespace UnityCli
|
|
|
652
652
|
SessionState.SetBool(DirectMutationEffectCommittedSessionKey, true);
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
-
/// <summary>code.
|
|
655
|
+
/// <summary>code.execute等内部direct命令在首个用户effect前同样重验完整lease identity。</summary>
|
|
656
656
|
private static void BeginDirectEffect(string requestId)
|
|
657
657
|
{
|
|
658
658
|
var requestDigest = SessionState.GetString(DirectMutationRequestDigestSessionKey, string.Empty);
|
|
@@ -821,15 +821,15 @@ namespace UnityCli
|
|
|
821
821
|
if (IsInstanceCleanupCommand(toolName)) return InstanceCleanupCompletionContract();
|
|
822
822
|
UnityCliToolCompletionContract contract;
|
|
823
823
|
if (UnityCliToolCompletionRegistry.TryGet(toolName, out contract)) return contract;
|
|
824
|
-
if (string.Equals(toolName, "code.
|
|
824
|
+
if (string.Equals(toolName, "code.execute", StringComparison.Ordinal))
|
|
825
825
|
return UnityCliToolCompletionRegistry.CodeExec;
|
|
826
826
|
return ResolveRegisteredCustomToolCompletionContract(toolName);
|
|
827
827
|
}
|
|
828
828
|
|
|
829
829
|
private static string RequestToolName(BridgeRequest request)
|
|
830
830
|
{
|
|
831
|
-
if (request != null && (string.Equals(request.Command, "
|
|
832
|
-
|| string.Equals(request.Command, "
|
|
831
|
+
if (request != null && (string.Equals(request.Command, "catalog.editor.run", StringComparison.Ordinal)
|
|
832
|
+
|| string.Equals(request.Command, "catalog.player.run", StringComparison.Ordinal)))
|
|
833
833
|
{
|
|
834
834
|
var input = request.Input as IDictionary<string, object>;
|
|
835
835
|
object rawName;
|
|
@@ -868,7 +868,7 @@ namespace UnityCli
|
|
|
868
868
|
if (IsInstanceCleanupCommand(toolName)) return InstanceCleanupCompletionContract();
|
|
869
869
|
UnityCliToolCompletionContract contract;
|
|
870
870
|
if (UnityCliToolCompletionRegistry.TryGet(toolName, out contract)) return contract;
|
|
871
|
-
return string.Equals(toolName, "code.
|
|
871
|
+
return string.Equals(toolName, "code.execute", StringComparison.Ordinal) ? UnityCliToolCompletionRegistry.CodeExec : null;
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
private sealed class DurableMutationBarrierProof
|
|
@@ -906,8 +906,8 @@ namespace UnityCli
|
|
|
906
906
|
var inputMutation = RequestMutationFromImmutableInput(contract.ToolName, input, out requiresSceneState);
|
|
907
907
|
if (!requiresSceneState) return inputMutation;
|
|
908
908
|
if (contract.ToolName == "physics.rigidbody") return RigidbodyNeedsMutation(input);
|
|
909
|
-
if (contract.ToolName == "
|
|
910
|
-
if (contract.ToolName == "
|
|
909
|
+
if (contract.ToolName == "lighting.reflection-probe") return CreateProbeNeedsMutation(input, true);
|
|
910
|
+
if (contract.ToolName == "lighting.light-probe-group") return CreateProbeNeedsMutation(input, false);
|
|
911
911
|
return true;
|
|
912
912
|
}
|
|
913
913
|
|
|
@@ -915,27 +915,27 @@ namespace UnityCli
|
|
|
915
915
|
private static bool RequestMutationFromImmutableInput(string name, IDictionary<string, object> input, out bool requiresSceneState)
|
|
916
916
|
{
|
|
917
917
|
requiresSceneState = false;
|
|
918
|
-
if (name == "
|
|
918
|
+
if (name == "lighting.reflection-probe")
|
|
919
919
|
{
|
|
920
920
|
if (HasAnyMeaningfulInput(input, "mode", "resolution", "bounces", "hdr", "boxSize", "boxOffset")) return true;
|
|
921
921
|
requiresSceneState = InputBoolean(input, "create");
|
|
922
922
|
return false;
|
|
923
923
|
}
|
|
924
|
-
if (name == "
|
|
924
|
+
if (name == "lighting.light-probe-group")
|
|
925
925
|
{
|
|
926
926
|
if (HasAnyMeaningfulInput(input, "positions")) return true;
|
|
927
927
|
requiresSceneState = InputBoolean(input, "create");
|
|
928
928
|
return false;
|
|
929
929
|
}
|
|
930
|
-
if (name == "
|
|
930
|
+
if (name == "lighting.skybox.set-properties") return HasAllMeaningfulInput(input, "property", "value");
|
|
931
931
|
if (name == "build.settings.set") return HasAnyInput(input, "apiCompatibilityLevel", "applicationIdentifier", "bundleVersion", "companyId", "productName", "scriptingBackend");
|
|
932
|
-
if (name == "
|
|
933
|
-
if (name == "
|
|
934
|
-
if (name == "
|
|
935
|
-
if (name == "
|
|
936
|
-
if (name == "
|
|
937
|
-
if (name == "
|
|
938
|
-
if (name == "
|
|
932
|
+
if (name == "lighting.bake.settings") return HasAnyInput(input, "bakedGI", "bounces", "directSamples", "environmentSamples", "filtering", "indirectSamples", "lightingMode", "realtimeGI");
|
|
933
|
+
if (name == "rendering.quality") return HasAnyInput(input, "anisotropicFiltering", "antiAliasing", "lodBias", "masterTextureLimit", "maximumLODLevel", "qualityLevel", "realtimeReflectionProbes", "shadowDistance", "shadowResolution", "shadows", "softParticles", "vSyncCount");
|
|
934
|
+
if (name == "rendering.pipeline.settings") return HasAnyInput(input, "renderPipeline");
|
|
935
|
+
if (name == "lighting.skybox.set-ambient") return HasAnyMeaningfulInput(input, "ambientEquatorColor", "ambientGroundColor", "ambientSkyColor", "color", "intensity", "mode");
|
|
936
|
+
if (name == "lighting.skybox.set-fog") return HasAnyMeaningfulInput(input, "color", "density", "enabled", "endDistance", "mode", "startDistance");
|
|
937
|
+
if (name == "lighting.skybox.set-reflection") return HasAnyMeaningfulInput(input, "bounces", "intensity", "mode", "resolution");
|
|
938
|
+
if (name == "rendering.scene-debug") return HasAnyInput(input, "drawMode", "shadingMode");
|
|
939
939
|
if (name == "physics.collision-matrix") return HasAllInput(input, "layerA", "layerB", "ignore");
|
|
940
940
|
if (name == "physics.settings") return HasAnyInput(input, "autoSimulation", "bounceThreshold", "defaultContactOffset", "defaultSolverIterations", "defaultSolverVelocityIterations", "gravity", "gravity2d", "property", "queriesHitBackfaces", "queriesHitTriggers", "queriesStartInColliders", "value");
|
|
941
941
|
if (name == "physics.rigidbody")
|
|
@@ -961,7 +961,7 @@ namespace UnityCli
|
|
|
961
961
|
{
|
|
962
962
|
var root = request.Input as IDictionary<string, object>;
|
|
963
963
|
if (root == null) return new Dictionary<string, object>();
|
|
964
|
-
if (string.Equals(request.Command, "
|
|
964
|
+
if (string.Equals(request.Command, "catalog.editor.run", StringComparison.Ordinal) || string.Equals(request.Command, "catalog.player.run", StringComparison.Ordinal))
|
|
965
965
|
{
|
|
966
966
|
object nested;
|
|
967
967
|
var typed = root.TryGetValue("input", out nested) ? nested as IDictionary<string, object> : null;
|
|
@@ -1037,10 +1037,10 @@ namespace UnityCli
|
|
|
1037
1037
|
{
|
|
1038
1038
|
if (IsEditorStateSnapshotCommand(command) || IsDoctorDiagnosticCommand(command)) return true;
|
|
1039
1039
|
return IsProjectToolCatalogReadCommand(command)
|
|
1040
|
-
|| string.Equals(command, "
|
|
1041
|
-
|| string.Equals(command, "
|
|
1042
|
-
|| string.Equals(command, "
|
|
1043
|
-
|| string.Equals(command, "
|
|
1040
|
+
|| string.Equals(command, "catalog.player.groups", StringComparison.Ordinal)
|
|
1041
|
+
|| string.Equals(command, "catalog.player.summary", StringComparison.Ordinal)
|
|
1042
|
+
|| string.Equals(command, "catalog.player.describe", StringComparison.Ordinal)
|
|
1043
|
+
|| string.Equals(command, "catalog.player.list", StringComparison.Ordinal);
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
1046
|
private static Dictionary<string, object> ValidateCoordinatedTerminal(string response, string requestId)
|
|
@@ -56,7 +56,7 @@ namespace UnityCli
|
|
|
56
56
|
Generation = generation,
|
|
57
57
|
Data = new Dictionary<string, object>
|
|
58
58
|
{
|
|
59
|
-
{ "command", "type.schema" }, { "typeName", FriendlyTypeName(type, context) }, { "schema", rootSchema },
|
|
59
|
+
{ "command", "runtime-reflection.type.schema" }, { "typeName", FriendlyTypeName(type, context) }, { "schema", rootSchema },
|
|
60
60
|
{ "memberCount", 0L }, { "returnedMemberCount", 0L }, { "definitionCount", (long)context.Definitions.Count }
|
|
61
61
|
}
|
|
62
62
|
};
|
|
@@ -80,7 +80,7 @@ namespace UnityCli
|
|
|
80
80
|
var typeDisplayName = FriendlyTypeName(type, context);
|
|
81
81
|
var schema = new Dictionary<string, object> { { "type", "object" }, { "typeName", typeDisplayName }, { "properties", rootProperties } };
|
|
82
82
|
if (context.Definitions.Count > 0) schema["$defs"] = context.Definitions;
|
|
83
|
-
var next = index < members.Length ? UnityCliContinuationToken.Create("type.schema", generation, "member:" + index.ToString(CultureInfo.InvariantCulture)) : null;
|
|
83
|
+
var next = index < members.Length ? UnityCliContinuationToken.Create("runtime-reflection.type.schema", generation, "member:" + index.ToString(CultureInfo.InvariantCulture)) : null;
|
|
84
84
|
return new Page
|
|
85
85
|
{
|
|
86
86
|
Truncated = next != null || context.Truncated,
|
|
@@ -88,7 +88,7 @@ namespace UnityCli
|
|
|
88
88
|
Generation = generation,
|
|
89
89
|
Data = new Dictionary<string, object>
|
|
90
90
|
{
|
|
91
|
-
{ "command", "type.schema" }, { "typeName", typeDisplayName }, { "schema", schema },
|
|
91
|
+
{ "command", "runtime-reflection.type.schema" }, { "typeName", typeDisplayName }, { "schema", schema },
|
|
92
92
|
{ "memberCount", (long)members.Length }, { "returnedMemberCount", (long)rootProperties.Count },
|
|
93
93
|
{ "definitionCount", (long)context.Definitions.Count }
|
|
94
94
|
}
|
|
@@ -99,7 +99,7 @@ namespace UnityCli
|
|
|
99
99
|
{
|
|
100
100
|
string position;
|
|
101
101
|
index = -1;
|
|
102
|
-
if (!UnityCliContinuationToken.TryParse(cursor, "type.schema", generation, out position)
|
|
102
|
+
if (!UnityCliContinuationToken.TryParse(cursor, "runtime-reflection.type.schema", generation, out position)
|
|
103
103
|
|| !position.StartsWith("member:", StringComparison.Ordinal)
|
|
104
104
|
|| !int.TryParse(position.Substring(7), NumberStyles.Integer, CultureInfo.InvariantCulture, out index)
|
|
105
105
|
|| index < 0 || index > memberCount) throw StaleSchemaCursor();
|
|
@@ -107,7 +107,7 @@ namespace UnityCli
|
|
|
107
107
|
|
|
108
108
|
private static BridgeCommandException StaleSchemaCursor()
|
|
109
109
|
{
|
|
110
|
-
return new BridgeCommandException("E_CONTINUATION_STALE", "The type.schema continuation does not match the current assembly generation and limits.", "Start a new type.schema read without cursor.");
|
|
110
|
+
return new BridgeCommandException("E_CONTINUATION_STALE", "The runtime-reflection.type.schema continuation does not match the current assembly generation and limits.", "Start a new runtime-reflection.type.schema read without cursor.");
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/// <summary>递归生成 schema;复杂嵌套类型通过 $defs/$ref 去重,避免循环类型无限展开。</summary>
|
|
@@ -538,9 +538,9 @@ namespace UnityCli
|
|
|
538
538
|
if (!string.IsNullOrEmpty(cursor))
|
|
539
539
|
{
|
|
540
540
|
string position;
|
|
541
|
-
if (!UnityCliContinuationToken.TryParse(cursor, "reflection.method.find", generation, out position)
|
|
541
|
+
if (!UnityCliContinuationToken.TryParse(cursor, "runtime-reflection.method.find", generation, out position)
|
|
542
542
|
|| !int.TryParse(position, NumberStyles.Integer, CultureInfo.InvariantCulture, out index) || index < 0 || index > methods.Length)
|
|
543
|
-
throw new BridgeCommandException("E_CONTINUATION_STALE", "The reflection method continuation does not match the current assembly generation and selector.", "Start a new reflection.method.find read without cursor.");
|
|
543
|
+
throw new BridgeCommandException("E_CONTINUATION_STALE", "The reflection method continuation does not match the current assembly generation and selector.", "Start a new runtime-reflection.method.find read without cursor.");
|
|
544
544
|
}
|
|
545
545
|
var pageStartIndex = index;
|
|
546
546
|
var result = new List<ReflectionMethodDescriptor>();
|
|
@@ -576,7 +576,7 @@ namespace UnityCli
|
|
|
576
576
|
}
|
|
577
577
|
if (index == pageStartIndex && index < methods.Length)
|
|
578
578
|
throw new UnityCliRequestBudgetExceededException(budget.ExhaustedDimension ?? "scannedRecords");
|
|
579
|
-
var next = index < methods.Length ? UnityCliContinuationToken.Create("reflection.method.find", generation, index.ToString(CultureInfo.InvariantCulture)) : null;
|
|
579
|
+
var next = index < methods.Length ? UnityCliContinuationToken.Create("runtime-reflection.method.find", generation, index.ToString(CultureInfo.InvariantCulture)) : null;
|
|
580
580
|
return new MethodPage { Methods = result, Total = methods.Length, NextCursor = next, Generation = generation, Truncated = next != null || budget.IsExhausted };
|
|
581
581
|
}
|
|
582
582
|
|
|
@@ -684,7 +684,7 @@ namespace UnityCli
|
|
|
684
684
|
|| typeof(CustomYieldInstruction).IsAssignableFrom(returnType))
|
|
685
685
|
throw new BridgeCommandException(
|
|
686
686
|
"E_METHOD_COMPLETION_UNPROVABLE",
|
|
687
|
-
"reflection.method.
|
|
687
|
+
"runtime-reflection.method.invoke cannot prove immediate completion for awaitable, yield, or AsyncOperation returns: " + returnType.FullName + ".",
|
|
688
688
|
"Use a dedicated Tool with an explicit business predicate and proof source.");
|
|
689
689
|
}
|
|
690
690
|
|
|
@@ -701,7 +701,7 @@ namespace UnityCli
|
|
|
701
701
|
if (parameterType == null)
|
|
702
702
|
{
|
|
703
703
|
if (budget.IsExhausted) throw new UnityCliRequestBudgetExceededException(budget.ExhaustedDimension);
|
|
704
|
-
throw new BridgeCommandException("E_TYPE_NOT_FOUND", "Parameter type not found: " + parameterTypeName, "Use the full parameterType returned by reflection.method.find.");
|
|
704
|
+
throw new BridgeCommandException("E_TYPE_NOT_FOUND", "Parameter type not found: " + parameterTypeName, "Use the full parameterType returned by runtime-reflection.method.find.");
|
|
705
705
|
}
|
|
706
706
|
selectedParameterTypes.Add(parameterType);
|
|
707
707
|
}
|
|
@@ -739,7 +739,7 @@ namespace UnityCli
|
|
|
739
739
|
{
|
|
740
740
|
throw new BridgeCommandException("E_METHOD_NOT_FOUND", "No overload matches the supplied reflection method signature: " + type.FullName + "." + methodName,
|
|
741
741
|
new Dictionary<string, object> { { "typeName", type.FullName }, { "methodName", methodName }, { "parameterTypes", parameterTypeNames ?? new List<string>() } },
|
|
742
|
-
new[] { "Run reflection.method.find and pass the returned parameterType values as parameterTypes." });
|
|
742
|
+
new[] { "Run runtime-reflection.method.find and pass the returned parameterType values as parameterTypes." });
|
|
743
743
|
}
|
|
744
744
|
|
|
745
745
|
var signatures = new List<string>();
|
|
@@ -755,7 +755,7 @@ namespace UnityCli
|
|
|
755
755
|
}
|
|
756
756
|
throw new BridgeCommandException("E_METHOD_AMBIGUOUS", "Multiple overloads match: " + type.FullName + "." + methodName,
|
|
757
757
|
new Dictionary<string, object> { { "typeName", type.FullName }, { "methodName", methodName }, { "candidateSignatures", signatures } },
|
|
758
|
-
new[] { "Run reflection.method.find and pass one returned signature's parameterType values as parameterTypes." });
|
|
758
|
+
new[] { "Run runtime-reflection.method.find and pass one returned signature's parameterType values as parameterTypes." });
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
private static bool MethodMatchesBindings(MethodInfo method, BindingFlags bindings, bool declaredOnTarget)
|
|
@@ -166,7 +166,7 @@ namespace UnityCli
|
|
|
166
166
|
WriteLog("runtime_tool_not_ready requestId=" + request.RequestId + " name=" + name + " sessionId=" + (currentPlayModeSessionId ?? "null"));
|
|
167
167
|
throw new BridgeCommandException("E_RUNTIME_NOT_READY",
|
|
168
168
|
"Runtime Tool cannot execute because the selected Editor is not in a ready Play Mode session.",
|
|
169
|
-
"Run unitycli tools run editor.play, wait until editor.state reports ready Play Mode, then retry.");
|
|
169
|
+
"Run unitycli tools run editor.play-mode.start, wait until editor.state reports ready Play Mode, then retry.");
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// Validate the tool exists and is a runtime tool
|
|
@@ -713,8 +713,8 @@ namespace UnityCli
|
|
|
713
713
|
|
|
714
714
|
private static bool IsProjectToolCatalogReadCommand(string command)
|
|
715
715
|
{
|
|
716
|
-
return command == "
|
|
717
|
-
|| command == "
|
|
716
|
+
return command == "catalog.editor.health" || command == "catalog.editor.groups" || command == "catalog.editor.summary" || command == "catalog.editor.describe" || command == "catalog.editor.list"
|
|
717
|
+
|| command == "catalog.player.groups" || command == "catalog.player.summary" || command == "catalog.player.describe" || command == "catalog.player.list";
|
|
718
718
|
}
|
|
719
719
|
|
|
720
720
|
private static object ProjectToolGroups(UnityCli.Protocol.BridgeRequest request) { return ProjectToolCatalogGroups(request, false); }
|
|
@@ -779,13 +779,13 @@ namespace UnityCli
|
|
|
779
779
|
new[] { "Enter Play Mode before running this Tool." });
|
|
780
780
|
}
|
|
781
781
|
|
|
782
|
-
// If the tool has Target=runtime, reject from
|
|
782
|
+
// If the tool has Target=runtime, reject from catalog.editor.run and suggest catalog.player.run
|
|
783
783
|
if (definition.Target == "runtime")
|
|
784
784
|
{
|
|
785
785
|
throw new BridgeCommandException("E_RUNTIME_TOOL_TARGET_MISMATCH",
|
|
786
|
-
"Tool " + name + " has Target=runtime and must be executed via the runtime path (
|
|
786
|
+
"Tool " + name + " has Target=runtime and must be executed via the runtime path (catalog.player.run).",
|
|
787
787
|
new Dictionary<string, object> { { "toolName", name }, { "toolTarget", definition.Target } },
|
|
788
|
-
new[] { "Use
|
|
788
|
+
new[] { "Use catalog.player.run <name> or tools run <name> with a runtime target to execute this tool in Play Mode." });
|
|
789
789
|
}
|
|
790
790
|
var dryRun = request.Execution != null && request.Execution.DryRun == true;
|
|
791
791
|
var timeoutMs = request.ExecutionTimeoutMs(definition.DefaultTimeoutMs, definition.MaxTimeoutMs);
|
|
@@ -23,7 +23,7 @@ namespace UnityCli
|
|
|
23
23
|
{
|
|
24
24
|
var path = SceneToolSupport.NormalizeAssetPath(rawPath);
|
|
25
25
|
if (string.IsNullOrEmpty(path))
|
|
26
|
-
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_PATH_REQUIRED", "Pass an Assets/*.anim path.", "Use tools run animation.
|
|
26
|
+
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_PATH_REQUIRED", "Pass an Assets/*.anim path.", "Use tools run animation-clip.read --input '{\"path\":\"Assets/Animations/Example.anim\"}'.");
|
|
27
27
|
if (!path.StartsWith("Assets/", System.StringComparison.OrdinalIgnoreCase) || !path.EndsWith(".anim", System.StringComparison.OrdinalIgnoreCase))
|
|
28
28
|
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_PATH_INVALID", "AnimationClip path must be under Assets/ and end with .anim: " + path, "Pass a Unity asset path such as Assets/Animations/Player.anim.");
|
|
29
29
|
return path;
|
|
@@ -53,7 +53,7 @@ namespace UnityCli
|
|
|
53
53
|
{
|
|
54
54
|
var clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(path);
|
|
55
55
|
if (clip == null)
|
|
56
|
-
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_NOT_FOUND", "AnimationClip asset not found: " + path, "Check the path or create one with animation
|
|
56
|
+
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_NOT_FOUND", "AnimationClip asset not found: " + path, "Check the path or create one with animation-clip.create.");
|
|
57
57
|
return clip;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -62,7 +62,7 @@ namespace UnityCli
|
|
|
62
62
|
{
|
|
63
63
|
var path = SceneToolSupport.NormalizeAssetPath(rawPath);
|
|
64
64
|
if (string.IsNullOrEmpty(path))
|
|
65
|
-
throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_PATH_REQUIRED", "Pass --controller-path <Assets/...>.controller>.", "Use controller.create to create one first.");
|
|
65
|
+
throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_PATH_REQUIRED", "Pass --controller-path <Assets/...>.controller>.", "Use animator-controller.create to create one first.");
|
|
66
66
|
if (!path.StartsWith("Assets/", System.StringComparison.Ordinal) || !path.EndsWith(".controller", System.StringComparison.OrdinalIgnoreCase))
|
|
67
67
|
throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_PATH_INVALID", "AnimatorController path must be a canonical Assets/*.controller path: " + path, "Pass a Unity asset path such as Assets/Animations/Player.controller.");
|
|
68
68
|
// 在任何 AssetDatabase 查找或创建目录前证明物理路径仍受 Assets/ 包含。
|
|
@@ -6,12 +6,12 @@ using UnityEngine;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>animation
|
|
9
|
+
/// <summary>animation-clip.create — 创建持久化 AnimationClip 资产。</summary>
|
|
10
10
|
public class AnimationClipCreateTool : IUnityCliTool<AnimationClipCreateTool.Request, AnimationClipCreateTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Path { get; set; } public bool? Overwrite { get; set; } public float? FrameRate { get; set; } public bool? Legacy { get; set; } public string WrapMode { get; set; } public bool? LoopTime { get; set; } public float? StartTime { get; set; } public float? StopTime { get; set; } public float? Length { get; set; } public int? MaxCurveKeys { get; set; } }
|
|
13
13
|
public sealed class Result { public bool DryRun { get; set; } public bool WouldOverwrite { get; set; } public AnimationClipInfo Clip { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animation
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animation-clip.create", Summary = "Create or overwrite a persistent AnimationClip asset at an Assets/*.anim path.", Description = "Create a new .anim asset with clip-level settings (frameRate, legacy, wrapMode, loopTime, startTime/stopTime/length). overwrite=true to replace existing.", Group = "animation-clip",DestructiveHint = true, SupportsDryRun = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create clip", Input = new Request { Path = "Assets/Animations/Created.anim", FrameRate = 30f, LoopTime = true } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var path = AnimationToolSupport.RequireAnimationClipPath(r.Path);
|
|
@@ -22,7 +22,7 @@ namespace UnityCli
|
|
|
22
22
|
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_CLIP_EXISTS", "AnimationClip already exists: " + path, "Pass overwrite:true after inspecting the existing clip, or choose another Assets/*.anim path.");
|
|
23
23
|
var dryRun = ctx.DryRun;
|
|
24
24
|
if (dryRun)
|
|
25
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = true, WouldOverwrite = existing != null, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation
|
|
25
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = true, WouldOverwrite = existing != null, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation-clip.create", Path = path } } });
|
|
26
26
|
ctx.CommitEffect();
|
|
27
27
|
SceneToolSupport.CreateAssetDirectory(path);
|
|
28
28
|
if (existing != null) AssetDatabase.DeleteAsset(path);
|
|
@@ -41,7 +41,7 @@ namespace UnityCli
|
|
|
41
41
|
var observedSettings = observedClip == null ? default(AnimationClipSettings) : AnimationUtility.GetAnimationClipSettings(observedClip);
|
|
42
42
|
if (observedClip == null || observedClip.name != clip.name || (r.FrameRate.HasValue && !Mathf.Approximately(observedClip.frameRate, r.FrameRate.Value)) || (r.Legacy.HasValue && observedClip.legacy != r.Legacy.Value) || (!string.IsNullOrEmpty(r.WrapMode) && observedClip.wrapMode != wm) || (r.LoopTime.HasValue && observedSettings.loopTime != r.LoopTime.Value) || (r.StartTime.HasValue && !Mathf.Approximately(observedSettings.startTime, r.StartTime.Value)) || (r.StopTime.HasValue && !Mathf.Approximately(observedSettings.stopTime, r.StopTime.Value)) || (r.Length.HasValue && !r.StopTime.HasValue && !Mathf.Approximately(observedSettings.stopTime - observedSettings.startTime, r.Length.Value)))
|
|
43
43
|
throw AnimationToolSupport.StateMismatch("E_ANIMATION_CLIP_CREATE_STATE_MISMATCH", "AnimationClip creation");
|
|
44
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = false, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, observedClip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation
|
|
44
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = false, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, observedClip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation-clip.create", Path = path } } });
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -6,12 +6,12 @@ using UnityEngine;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>animation.
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>animation-clip.read — 读取 AnimationClip 资产的设置、绑定曲线和事件。</summary>
|
|
10
|
+
public class AnimationClipReadTool : IUnityCliTool<AnimationClipReadTool.Request, AnimationClipReadTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Path { get; set; } public int? MaxCurveKeys { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimationClipInfo Clip { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animation.
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animation-clip.read", Summary = "Read an AnimationClip asset's settings, curve bindings, and events.", Description = "Read Assets/*.anim AnimationClip settings, events, and bounded curve summaries. maxCurveKeys limits keys per binding (default 5).", Group = "animation-clip",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read clip", Input = new Request { Path = "Assets/Animations/Idle.anim" } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var path = AnimationToolSupport.RequireAnimationClipPath(r.Path);
|
|
@@ -6,12 +6,12 @@ using UnityEngine;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>animation
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>animation-clip.update — 修改已存在 AnimationClip 的 clip 级设置。</summary>
|
|
10
|
+
public class AnimationClipUpdateTool : IUnityCliTool<AnimationClipUpdateTool.Request, AnimationClipUpdateTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Path { get; set; } public float? FrameRate { get; set; } public bool? Legacy { get; set; } public string WrapMode { get; set; } public bool? LoopTime { get; set; } public float? StartTime { get; set; } public float? StopTime { get; set; } public float? Length { get; set; } public int? MaxCurveKeys { get; set; } }
|
|
13
13
|
public sealed class Result { public bool DryRun { get; set; } public AnimationClipInfo Clip { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animation
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animation-clip.update", Summary = "Update clip-level settings on an existing AnimationClip asset.", Description = "Modify frameRate, legacy, wrapMode, loopTime, startTime/stopTime/length on an existing .anim asset. Does not touch curves or events.", Group = "animation-clip",DestructiveHint = true, SupportsDryRun = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set loop time", Input = new Request { Path = "Assets/Animations/Walk.anim", LoopTime = true } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var path = AnimationToolSupport.RequireAnimationClipPath(r.Path);
|
|
@@ -19,7 +19,7 @@ namespace UnityCli
|
|
|
19
19
|
var wm = AnimationToolSupport.ValidateClipSettings(r.FrameRate, r.WrapMode, r.StartTime, r.StopTime, r.Length);
|
|
20
20
|
var dryRun = ctx.DryRun;
|
|
21
21
|
if (dryRun)
|
|
22
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = true, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, clip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation
|
|
22
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = true, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, clip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation-clip.update", Path = path } } });
|
|
23
23
|
ctx.CommitEffect();
|
|
24
24
|
Undo.RecordObject(clip, "Modify AnimationClip Settings");
|
|
25
25
|
if (r.FrameRate.HasValue) clip.frameRate = r.FrameRate.Value;
|
|
@@ -36,7 +36,7 @@ namespace UnityCli
|
|
|
36
36
|
var observedSettings = observedClip == null ? default(AnimationClipSettings) : AnimationUtility.GetAnimationClipSettings(observedClip);
|
|
37
37
|
if (observedClip == null || (r.FrameRate.HasValue && !Mathf.Approximately(observedClip.frameRate, r.FrameRate.Value)) || (r.Legacy.HasValue && observedClip.legacy != r.Legacy.Value) || (!string.IsNullOrEmpty(r.WrapMode) && observedClip.wrapMode != wm) || (r.LoopTime.HasValue && observedSettings.loopTime != r.LoopTime.Value) || (r.StartTime.HasValue && !Mathf.Approximately(observedSettings.startTime, r.StartTime.Value)) || (r.StopTime.HasValue && !Mathf.Approximately(observedSettings.stopTime, r.StopTime.Value)) || (r.Length.HasValue && !r.StopTime.HasValue && !Mathf.Approximately(observedSettings.stopTime - observedSettings.startTime, r.Length.Value)))
|
|
38
38
|
throw AnimationToolSupport.StateMismatch("E_ANIMATION_CLIP_MODIFY_STATE_MISMATCH", "AnimationClip settings");
|
|
39
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = false, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, observedClip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation
|
|
39
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { DryRun = false, Clip = AnimationToolSupport.BuildAnimationClipInfo(path, observedClip, r.MaxCurveKeys ?? 5), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation-clip.update", Path = path } } });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -19,7 +19,7 @@ namespace UnityCli
|
|
|
19
19
|
Name = "animator.crossfade",
|
|
20
20
|
Summary = "Cross-fade an Animator to a named state with fresh state readback.",
|
|
21
21
|
Description = "Cross-fade a resolved Animator to a named state. The tool validates the controller, layer and state before one effect, then reads current and next state from the same Animator layer before returning.",
|
|
22
|
-
Group = "
|
|
22
|
+
Group = "animator",DestructiveHint = false,
|
|
23
23
|
SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported",
|
|
24
24
|
DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000,
|
|
25
25
|
Examples = new[] { new ToolExample { Description = "Crossfade to Run", Input = new Request { Target = "Player", State = "Run", Duration = 0.3f } } }
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimatorInfo Animator { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animator.get-info", Summary = "Read Animator details: layers, parameters, clips, and runtime controller.", Description = "Resolve a target with an Animator and return enabled, speed, layerCount, parameters, layers, and clips.", Group = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.get-info", Summary = "Read Animator details: layers, parameters, clips, and runtime controller.", Description = "Resolve a target with an Animator and return enabled, speed, layerCount, parameters, layers, and clips.", Group = "animator",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read animator info", Input = new Request { Target = "Player" } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animator info requires --target <go>.");
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public string ParameterName { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimatorParameterWithValue Parameter { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animator.get-parameter", Summary = "Read a single Animator parameter's current or default value.", Description = "Resolve a target with an Animator and read a named parameter. Returns runtime value if available, otherwise the controller default.", Group = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.get-parameter", Summary = "Read a single Animator parameter's current or default value.", Description = "Resolve a target with an Animator and read a named parameter. Returns runtime value if available, otherwise the controller default.", Group = "animator",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read Speed parameter", Input = new Request { Target = "Player", ParameterName = "Speed" } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animator get-parameter requires --target <go>.");
|
|
@@ -6,12 +6,12 @@ using UnityEngine;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>animator.get-state — 读取目标 Animator 的当前状态信息。</summary>
|
|
10
|
+
public class AnimatorGetStateTool : IUnityCliTool<AnimatorGetStateTool.Request, AnimatorGetStateTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public int? Layer { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimatorInfo Animator { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.get-state", Summary = "Read the current Animator state for a target GameObject.", Description = "Resolve a target with an Animator and return current state info (layer, state hash, normalized time).", Group = "animator",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read animation state", Input = new Request { Target = "Player" } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animation state requires --target <go>.");
|
|
@@ -6,12 +6,12 @@ using UnityEngine;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>animator.play — 播放指定 Animator 状态。</summary>
|
|
10
|
+
public class AnimatorPlayTool : IUnityCliTool<AnimatorPlayTool.Request, AnimatorPlayTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public string State { get; set; } public int? Layer { get; set; } public float? NormalizedTime { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimatorInfo Animator { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.play", Summary = "Play a named Animator state on a target GameObject.", Description = "Resolve a target with an Animator and play the named state on the given layer.", Group = "animator",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Play Walk state", Input = new Request { Target = "Player", State = "Walk" } } } };
|
|
15
15
|
public async System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animation play requires --target <go>.");
|
|
@@ -22,7 +22,7 @@ namespace UnityCli
|
|
|
22
22
|
throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_NO_CONTROLLER", "Animator has no RuntimeAnimatorController assigned or no effective layers: " + GameObjectToolSupport.HierarchyPath(go), "Assign a RuntimeAnimatorController with at least one layer.");
|
|
23
23
|
if (string.IsNullOrEmpty(r.State)) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_STATE_REQUIRED", "Animation play requires --state <name>.", "Pass an Animator state name.");
|
|
24
24
|
var layer = r.Layer ?? 0;
|
|
25
|
-
if (layer < 0 || layer >= effectiveLayerCount) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_LAYER_INVALID", "Animator layer is out of range: " + layer, "Run
|
|
25
|
+
if (layer < 0 || layer >= effectiveLayerCount) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_LAYER_INVALID", "Animator layer is out of range: " + layer, "Run animator.get-state to inspect layer count.");
|
|
26
26
|
var controller = animator.runtimeAnimatorController as AnimatorController;
|
|
27
27
|
var state = controller == null || layer >= controller.layers.Length ? null : AnimationToolSupport.FindStateInLayer(controller.layers[layer].stateMachine, r.State);
|
|
28
28
|
if (state == null) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_STATE_UNOBSERVABLE", "Animation state cannot be resolved to a stable Animator readback: " + r.State, "Pass a root state name from the selected AnimatorController layer.");
|
|
@@ -34,7 +34,7 @@ namespace UnityCli
|
|
|
34
34
|
if (!observed) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_STATE_TIMEOUT", "Animator did not reach the requested state before timeout: " + r.State, "Check Animator transitions and retry after the requested state is reachable.");
|
|
35
35
|
UnityCliSceneMutation.MarkSceneObjectDirty(animator);
|
|
36
36
|
var finalAnimator = AnimationToolSupport.BuildAnimatorInfo(animator, layer);
|
|
37
|
-
return new Result { Animator = finalAnimator, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "
|
|
37
|
+
return new Result { Animator = finalAnimator, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator.play", Target = GameObjectToolSupport.HierarchyPath(go), State = r.State } } };
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public bool? Value { get; set; } }
|
|
13
13
|
public sealed class Result { public bool Enabled { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animator.set-enabled", Summary = "Enable or disable an Animator component on a target GameObject.", Description = "Resolve a target with an Animator and set animator.enabled. Defaults to true.", Group = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.set-enabled", Summary = "Enable or disable an Animator component on a target GameObject.", Description = "Resolve a target with an Animator and set animator.enabled. Defaults to true.", Group = "animator",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Disable animator", Input = new Request { Target = "Player", Value = false } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animator set-enabled requires --target <go>.");
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public string ParameterName { get; set; } public string Value { get; set; } }
|
|
13
13
|
public sealed class Result { public AnimatorParameterRef Parameter { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animator.set-parameter", Summary = "Set an Animator parameter default value by editing the AnimatorController asset.", Description = "In edit mode, modifies the AnimatorController asset parameter defaults. Requires an AnimatorController assigned to the Animator.", Group = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.set-parameter", Summary = "Set an Animator parameter default value by editing the AnimatorController asset.", Description = "In edit mode, modifies the AnimatorController asset parameter defaults. Requires an AnimatorController assigned to the Animator.", Group = "animator",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set Speed default", Input = new Request { Target = "Player", ParameterName = "Speed", Value = "0.5" } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animator set-parameter requires --target <go>.");
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Target { get; set; } public float? Speed { get; set; } }
|
|
13
13
|
public sealed class Result { public double Speed { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "animator.set-speed", Summary = "Set the playback speed of an Animator component.", Description = "Resolve a target with an Animator and set animator.speed. Defaults to 1.0.", Group = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "animator.set-speed", Summary = "Set the playback speed of an Animator component.", Description = "Resolve a target with an Animator and set animator.speed. Defaults to 1.0.", Group = "animator",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set speed to 2x", Input = new Request { Target = "Player", Speed = 2f } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animator set-speed requires --target <go>.");
|