@alpsckr/unitycli 0.4.4 → 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 +27 -9
- package/dist/bridge/session-supervisor.js.map +1 -1
- package/dist/bridge/start-diagnostics.d.ts +19 -0
- package/dist/bridge/start-diagnostics.js +96 -0
- package/dist/bridge/start-diagnostics.js.map +1 -0
- 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/cli-commands/package.js +10 -2
- package/dist/cli-commands/package.js.map +1 -1
- package/dist/doctor.js +23 -1
- package/dist/doctor.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/extensions/installer.d.ts +35 -0
- package/dist/extensions/installer.js +123 -0
- package/dist/extensions/installer.js.map +1 -1
- package/dist/instances.d.ts +6 -0
- package/dist/instances.js +13 -0
- package/dist/instances.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
|
@@ -7,7 +7,7 @@ using UnityEngine;
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
9
|
/// <summary>
|
|
10
|
-
///
|
|
10
|
+
/// game-object.modify — 修改一个或多个 GameObject 的名称/active/标签/层/绝对变换。
|
|
11
11
|
/// </summary>
|
|
12
12
|
public class GameObjectModifyTool : IUnityCliTool<GameObjectModifyTool.Request, GameObjectModifyTool.Result>
|
|
13
13
|
{
|
|
@@ -41,10 +41,10 @@ namespace UnityCli
|
|
|
41
41
|
|
|
42
42
|
public ToolDescriptor Describe() => new()
|
|
43
43
|
{
|
|
44
|
-
Name = "
|
|
44
|
+
Name = "game-object.modify",
|
|
45
45
|
Summary = "Modify one or more GameObjects' name, active state, tag, layer, absolute transform values, or parent.",
|
|
46
46
|
Description = "Modify one or more GameObjects' name, active state, tag, layer, absolute transform values, or parent. Pass target for one object or targets[] to apply the same mutation to multiple objects in one all-or-none call; every target must resolve uniquely before any scene object is changed.",
|
|
47
|
-
Group = "
|
|
47
|
+
Group = "game-object",
|
|
48
48
|
DestructiveHint = false,
|
|
49
49
|
SideEffects = new[] { "scene-modify", "undo-stack" },
|
|
50
50
|
Target = "editor",
|
|
@@ -60,7 +60,7 @@ namespace UnityCli
|
|
|
60
60
|
|
|
61
61
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request request, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
62
62
|
{
|
|
63
|
-
GameObjectToolSupport.EnsureEditorNotBusy("
|
|
63
|
+
GameObjectToolSupport.EnsureEditorNotBusy("game-object.modify");
|
|
64
64
|
// 先完整校验,避免前半成功后半失败的部分写入
|
|
65
65
|
GameObjectToolSupport.ValidateMutationInputs(request.TagValue, request.LayerValue);
|
|
66
66
|
GameObjectToolSupport.ValidateTransformMutationValues(request.X, request.Y, request.Z, request.RotationX, request.RotationY, request.RotationZ, request.ScaleX, request.ScaleY, request.ScaleZ);
|
|
@@ -77,7 +77,7 @@ namespace UnityCli
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
ctx.CommitEffect();
|
|
80
|
-
var undoGroup = UnityCliSceneMutation.BeginUndoGroup("
|
|
80
|
+
var undoGroup = UnityCliSceneMutation.BeginUndoGroup("game-object.modify");
|
|
81
81
|
try
|
|
82
82
|
{
|
|
83
83
|
var details = new List<GameObjectDetail>();
|
|
@@ -86,8 +86,8 @@ namespace UnityCli
|
|
|
86
86
|
{
|
|
87
87
|
var gameObject = EditorUtility.InstanceIDToObject(plan.Id) as GameObject;
|
|
88
88
|
if (gameObject == null) throw new UnityCliBridge.BridgeCommandException("E_TARGET_NOT_FOUND", "GameObject disappeared before modification.", "Retry after the Editor is idle.");
|
|
89
|
-
UnityCliSceneMutation.RecordObject(gameObject.transform, "
|
|
90
|
-
UnityCliSceneMutation.RecordObject(gameObject, "
|
|
89
|
+
UnityCliSceneMutation.RecordObject(gameObject.transform, "game-object.modify");
|
|
90
|
+
UnityCliSceneMutation.RecordObject(gameObject, "game-object.modify");
|
|
91
91
|
GameObjectToolSupport.ApplyGameObjectMutations(gameObject, request.NewName, request.Active, request.TagValue, request.LayerValue,
|
|
92
92
|
request.X, request.Y, request.Z, request.RotationX, request.RotationY, request.RotationZ, request.ScaleX, request.ScaleY, request.ScaleZ);
|
|
93
93
|
if (parent != null) gameObject.transform.SetParent(parent.transform, true);
|
|
@@ -99,7 +99,7 @@ namespace UnityCli
|
|
|
99
99
|
if (observed == null || !MatchesRequest(observed, request) || (request.Parent != null && (observed.transform.parent == null || observed.transform.parent.GetInstanceID() != parentId)))
|
|
100
100
|
throw new UnityCliBridge.BridgeCommandException("E_GO_MODIFY_STATE_MISMATCH", "GameObject did not satisfy the requested mutation after write.", "Inspect the scene object and retry after the Editor is idle.");
|
|
101
101
|
details.Add(GameObjectToolSupport.BuildGameObjectDetail(observed));
|
|
102
|
-
effects.Add(new GameObjectPlannedEffect { Type = "
|
|
102
|
+
effects.Add(new GameObjectPlannedEffect { Type = "game-object.modify", Target = GameObjectToolSupport.HierarchyPath(observed) });
|
|
103
103
|
}
|
|
104
104
|
if (details.Count == 1) return new System.Threading.Tasks.ValueTask<Result>(new Result { GameObject = details[0], ModifiedCount = 1, PlannedEffects = effects });
|
|
105
105
|
return new System.Threading.Tasks.ValueTask<Result>(new Result { GameObjects = details, ModifiedCount = details.Count, PlannedEffects = effects });
|
|
@@ -107,7 +107,7 @@ namespace UnityCli
|
|
|
107
107
|
finally { UnityCliSceneMutation.EndUndoGroup(undoGroup); }
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// game-object.modify 支持 targets[] 批量修改;先完整解析,避免部分写入
|
|
111
111
|
private sealed class ModifyPlan { public int Id { get; set; } }
|
|
112
112
|
|
|
113
113
|
private static bool MatchesRequest(GameObject observed, Request request)
|
|
@@ -7,7 +7,7 @@ using UnityEngine;
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
9
|
/// <summary>
|
|
10
|
-
///
|
|
10
|
+
/// game-object.move-relative — 按 XYZ 偏移移动 GameObject,不替换绝对变换。
|
|
11
11
|
/// </summary>
|
|
12
12
|
public class GameObjectMoveRelativeTool : IUnityCliTool<GameObjectMoveRelativeTool.Request, GameObjectMoveRelativeTool.Result>
|
|
13
13
|
{
|
|
@@ -27,10 +27,10 @@ namespace UnityCli
|
|
|
27
27
|
|
|
28
28
|
public ToolDescriptor Describe() => new()
|
|
29
29
|
{
|
|
30
|
-
Name = "
|
|
30
|
+
Name = "game-object.move-relative",
|
|
31
31
|
Summary = "Move a GameObject by a relative XYZ offset without replacing its absolute transform.",
|
|
32
|
-
Description = "Move a GameObject by a relative XYZ offset without replacing its absolute transform. Use
|
|
33
|
-
Group = "
|
|
32
|
+
Description = "Move a GameObject by a relative XYZ offset without replacing its absolute transform. Use game-object.modify when you need absolute position; prefer hierarchy paths or instance ids after create/duplicate operations.",
|
|
33
|
+
Group = "game-object",
|
|
34
34
|
DestructiveHint = false,
|
|
35
35
|
SideEffects = new[] { "scene-modify", "undo-stack" },
|
|
36
36
|
Target = "editor",
|
|
@@ -45,7 +45,7 @@ namespace UnityCli
|
|
|
45
45
|
|
|
46
46
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request request, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
47
47
|
{
|
|
48
|
-
GameObjectToolSupport.EnsureEditorNotBusy("
|
|
48
|
+
GameObjectToolSupport.EnsureEditorNotBusy("game-object.move-relative");
|
|
49
49
|
if (string.IsNullOrEmpty(request.Target))
|
|
50
50
|
{
|
|
51
51
|
throw new UnityCliBridge.BridgeCommandException("E_TARGET_NOT_FOUND", "GameObject move-relative requires a target.", "Pass a GameObject name, hierarchy path or instance id.");
|
|
@@ -57,7 +57,7 @@ namespace UnityCli
|
|
|
57
57
|
// 以写入前位置加请求偏移冻结期望值,不能用写后旧引用自证。
|
|
58
58
|
var expectedPosition = gameObject.transform.position + offset;
|
|
59
59
|
ctx.CommitEffect();
|
|
60
|
-
UnityCliSceneMutation.RecordObject(gameObject.transform, "
|
|
60
|
+
UnityCliSceneMutation.RecordObject(gameObject.transform, "game-object.move-relative");
|
|
61
61
|
gameObject.transform.position = expectedPosition;
|
|
62
62
|
UnityCliSceneMutation.MarkSceneDirty(gameObject.scene);
|
|
63
63
|
var observed = EditorUtility.InstanceIDToObject(gameObjectId) as GameObject;
|
|
@@ -66,7 +66,7 @@ namespace UnityCli
|
|
|
66
66
|
return new System.Threading.Tasks.ValueTask<Result>(new Result
|
|
67
67
|
{
|
|
68
68
|
GameObject = GameObjectToolSupport.BuildGameObjectDetail(observed),
|
|
69
|
-
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "
|
|
69
|
+
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "game-object.move-relative", Target = GameObjectToolSupport.HierarchyPath(gameObject) } }
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -7,9 +7,9 @@ using UnityEngine.SceneManagement;
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
9
|
/// <summary>
|
|
10
|
-
///
|
|
10
|
+
/// game-object.move-to-scene — 将 GameObject 移动到另一个已加载场景。
|
|
11
11
|
/// </summary>
|
|
12
|
-
public class
|
|
12
|
+
public class GameObjectMoveToSceneTool : IUnityCliTool<GameObjectMoveToSceneTool.Request, GameObjectMoveToSceneTool.Result>
|
|
13
13
|
{
|
|
14
14
|
public sealed class Request
|
|
15
15
|
{
|
|
@@ -32,10 +32,10 @@ namespace UnityCli
|
|
|
32
32
|
|
|
33
33
|
public ToolDescriptor Describe() => new()
|
|
34
34
|
{
|
|
35
|
-
Name = "
|
|
35
|
+
Name = "game-object.move-to-scene",
|
|
36
36
|
Summary = "Move a GameObject from its current scene into another already-loaded scene.",
|
|
37
37
|
Description = "Move a GameObject (resolved by target path or instanceId) into another already-loaded destination scene (--scene path). Useful for multi-scene editing. Requires the destination scene to be loaded (scene.load); returns moved=false if the object is already in the destination.",
|
|
38
|
-
Group = "
|
|
38
|
+
Group = "game-object",
|
|
39
39
|
DestructiveHint = false,
|
|
40
40
|
SupportsDryRun = true,
|
|
41
41
|
SideEffects = new[] { "scene-modify" },
|
|
@@ -52,13 +52,13 @@ namespace UnityCli
|
|
|
52
52
|
// 移动对象后读取场景标识,确保返回的是已生效的场景归属。
|
|
53
53
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request request, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
54
54
|
{
|
|
55
|
-
SceneToolSupport.EnsureEditorNotBusy("
|
|
55
|
+
SceneToolSupport.EnsureEditorNotBusy("game-object.move-to-scene");
|
|
56
56
|
var target = request.Target ?? request.Path;
|
|
57
57
|
var instanceId = request.InstanceId;
|
|
58
58
|
var destScenePath = request.Scene;
|
|
59
59
|
if (string.IsNullOrEmpty(destScenePath))
|
|
60
60
|
{
|
|
61
|
-
throw new UnityCliBridge.BridgeCommandException("E_SCENE_DESTINATION_REQUIRED", "
|
|
61
|
+
throw new UnityCliBridge.BridgeCommandException("E_SCENE_DESTINATION_REQUIRED", "game-object.move-to-scene requires --scene (destination scene path).", "Run tools run scene.list-opened to list loaded scenes.");
|
|
62
62
|
}
|
|
63
63
|
GameObject go = null;
|
|
64
64
|
if (instanceId.HasValue && instanceId.Value != 0)
|
|
@@ -96,7 +96,7 @@ namespace UnityCli
|
|
|
96
96
|
DryRun = true,
|
|
97
97
|
PlannedEffects = new List<ScenePlannedEffect>
|
|
98
98
|
{
|
|
99
|
-
new ScenePlannedEffect { Type = "
|
|
99
|
+
new ScenePlannedEffect { Type = "game-object.move-to-scene", Target = go.name }
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -7,7 +7,7 @@ using UnityEngine;
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
9
|
/// <summary>
|
|
10
|
-
///
|
|
10
|
+
/// game-object.set-parent — 将 GameObject 重新父级化到另一个 GameObject 或脱离到场景根。支持 dryRun。
|
|
11
11
|
/// </summary>
|
|
12
12
|
public class GameObjectSetParentTool : IUnityCliTool<GameObjectSetParentTool.Request, GameObjectSetParentTool.Result>
|
|
13
13
|
{
|
|
@@ -26,10 +26,10 @@ namespace UnityCli
|
|
|
26
26
|
|
|
27
27
|
public ToolDescriptor Describe() => new()
|
|
28
28
|
{
|
|
29
|
-
Name = "
|
|
29
|
+
Name = "game-object.set-parent",
|
|
30
30
|
Summary = "Reparent a GameObject under another GameObject or detach it to the scene root.",
|
|
31
31
|
Description = "Reparent a GameObject under another GameObject or detach it to the scene root. Prefer hierarchy paths or instance ids for target and parent; plain names can be ambiguous after duplicate/create operations. Use --dry-run first for hierarchy work; worldPositionStays defaults to true.",
|
|
32
|
-
Group = "
|
|
32
|
+
Group = "game-object",
|
|
33
33
|
DestructiveHint = false,
|
|
34
34
|
SupportsDryRun = true,
|
|
35
35
|
SideEffects = new[] { "scene-modify", "undo-stack", "hierarchy-reparent" },
|
|
@@ -46,12 +46,12 @@ namespace UnityCli
|
|
|
46
46
|
|
|
47
47
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request request, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
48
48
|
{
|
|
49
|
-
GameObjectToolSupport.EnsureEditorNotBusy("
|
|
49
|
+
GameObjectToolSupport.EnsureEditorNotBusy("game-object.set-parent");
|
|
50
50
|
if (string.IsNullOrEmpty(request.Target))
|
|
51
51
|
{
|
|
52
|
-
throw new UnityCliBridge.BridgeCommandException("E_TARGET_NOT_FOUND", "
|
|
52
|
+
throw new UnityCliBridge.BridgeCommandException("E_TARGET_NOT_FOUND", "game-object.set-parent requires a target.", "Pass a GameObject name, hierarchy path or instance id.");
|
|
53
53
|
}
|
|
54
|
-
var gameObject = GameObjectToolSupport.ResolveUniqueTarget(request.Target, "
|
|
54
|
+
var gameObject = GameObjectToolSupport.ResolveUniqueTarget(request.Target, "game-object.set-parent requires a target.");
|
|
55
55
|
var parentName = request.Parent;
|
|
56
56
|
var worldPositionStays = request.WorldPositionStays ?? true;
|
|
57
57
|
var newParent = string.IsNullOrEmpty(parentName) ? null : GameObjectToolSupport.ResolveUniqueTarget(parentName, "Parent GameObject is required.").transform;
|
|
@@ -64,11 +64,11 @@ namespace UnityCli
|
|
|
64
64
|
return new System.Threading.Tasks.ValueTask<Result>(new Result
|
|
65
65
|
{
|
|
66
66
|
DryRun = true,
|
|
67
|
-
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "
|
|
67
|
+
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "game-object.set-parent", Parent = parentName ?? "<root>" } }
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
ctx.CommitEffect();
|
|
71
|
-
UnityCliSceneMutation.SetParent(gameObject.transform, newParent, "
|
|
71
|
+
UnityCliSceneMutation.SetParent(gameObject.transform, newParent, "game-object.set-parent", worldPositionStays);
|
|
72
72
|
UnityCliSceneMutation.MarkSceneDirty(gameObject.scene);
|
|
73
73
|
var observed = EditorUtility.InstanceIDToObject(targetId) as GameObject;
|
|
74
74
|
var observedParent = parentId == 0 ? null : EditorUtility.InstanceIDToObject(parentId) as Transform;
|
|
@@ -76,7 +76,7 @@ namespace UnityCli
|
|
|
76
76
|
throw new UnityCliBridge.BridgeCommandException("E_GO_SET_PARENT_STATE_MISMATCH", "GameObject hierarchy did not match the requested parent after write.", "Inspect the hierarchy and retry after the Editor is idle.");
|
|
77
77
|
return new System.Threading.Tasks.ValueTask<Result>(new Result
|
|
78
78
|
{
|
|
79
|
-
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "
|
|
79
|
+
PlannedEffects = new List<GameObjectPlannedEffect> { new GameObjectPlannedEffect { Type = "game-object.set-parent" } }
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -6,12 +6,12 @@ using UnityEngine.SceneManagement;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.bake.cancel — 取消正在运行的光照烘焙。</summary>
|
|
10
|
+
public class LightingBakeCancelTool : IUnityCliTool<LightingBakeCancelTool.Request, LightingBakeCancelTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { }
|
|
13
13
|
public sealed class Result { public bool Baking { get; set; } public bool Cancelled { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.cancel", Summary = "Cancel a running lightmap bake.", Description = "Cancel the active Lightmapping bake if one is running. Returns cancelled=true only when a bake was in progress.", Group = "lighting",DestructiveHint = false, SideEffects = new[] { "lightmapping-bake-cancel" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Cancel bake", Input = new Request { } } } };
|
|
15
15
|
public async System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var wasRunning = Lightmapping.isRunning;
|
|
@@ -20,7 +20,7 @@ namespace UnityCli
|
|
|
20
20
|
var observed = await ctx.Wait.UntilStable(() => !Lightmapping.isRunning, System.TimeSpan.FromMilliseconds(ctx.TimeoutMs), ct: ct);
|
|
21
21
|
if (!observed) throw new UnityCliBridge.BridgeCommandException("E_BAKE_CANCEL_TIMEOUT", "Lightmapping did not leave the baking state before timeout.", "Wait for the current bake to finish or inspect Unity Console before retrying.");
|
|
22
22
|
var baking = Lightmapping.isRunning;
|
|
23
|
-
return new Result { Baking = baking, Cancelled = wasRunning, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "
|
|
23
|
+
return new Result { Baking = baking, Cancelled = wasRunning, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "lighting.bake.cancel", Property = "bake", Value = "cancelled" } } };
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -6,12 +6,12 @@ using UnityEngine.SceneManagement;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.bake.clear — 清除光照烘焙数据。</summary>
|
|
10
|
+
public class LightingBakeClearTool : IUnityCliTool<LightingBakeClearTool.Request, LightingBakeClearTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public bool? BakedData { get; set; } public bool? RealtimeData { get; set; } }
|
|
13
13
|
public sealed class Result { public bool ClearedBakedData { get; set; } public bool ClearedRealtimeData { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.clear", Summary = "Clear the observable baked lighting data asset.", Description = "Clear the baked lighting data asset and verify Lightmapping.lightingDataAsset is null. realtimeData=true is rejected because Unity exposes no reliable realtime-data completion readback.", Group = "lighting",DestructiveHint = true, SideEffects = new[] { "bake" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Clear baked lighting data", Input = new Request { BakedData = true } } } };
|
|
15
15
|
// 清除可验证的烘焙数据,并拒绝无法可靠证明的实时数据请求。
|
|
16
16
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
17
17
|
{
|
|
@@ -24,7 +24,7 @@ namespace UnityCli
|
|
|
24
24
|
var observedBakedCleared = Lightmapping.lightingDataAsset == null;
|
|
25
25
|
if (clearedBaked && !observedBakedCleared)
|
|
26
26
|
throw new UnityCliBridge.BridgeCommandException("E_GRAPHICS_BAKED_CLEAR_STATE_MISMATCH", "Unity still exposes a baked lighting data asset after clearing.", "Inspect the Lighting window and retry after the Editor is idle.");
|
|
27
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { ClearedBakedData = clearedBaked && observedBakedCleared, ClearedRealtimeData = false, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "
|
|
27
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { ClearedBakedData = clearedBaked && observedBakedCleared, ClearedRealtimeData = false, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "lighting.bake.clear", Property = "lightingData", Value = "cleared" } } });
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -5,11 +5,11 @@ using UnityEditor;
|
|
|
5
5
|
using UnityEngine;
|
|
6
6
|
namespace UnityCli
|
|
7
7
|
{
|
|
8
|
-
public class
|
|
8
|
+
public class LightingBakeReflectionProbeTool : IUnityCliTool<LightingBakeReflectionProbeTool.Request, LightingBakeReflectionProbeTool.Result>
|
|
9
9
|
{
|
|
10
10
|
public sealed class Request { public string Target { get; set; } public string Path { get; set; } }
|
|
11
11
|
public sealed class Result { public ReflectionProbeInfo Probe { get; set; } public bool Baked { get; set; } public string ArtifactPath { get; set; } public long SizeBytes { get; set; } public string Sha256 { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
12
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
12
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.reflection-probe", Summary = "Bake a single ReflectionProbe to an .exr cubemap asset.", Description = "Bake a ReflectionProbe to an .exr path. The parent Assets folder must already exist; a missing parent fails before Unity starts the bake.", Group = "lighting",DestructiveHint = true, SideEffects = new[] { "bake", "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Bake one reflection probe", Input = new Request { Target = "ReflectionProbe", Path = "Assets/Reflections/ReflectionProbe.exr" } } } };
|
|
13
13
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
14
14
|
{
|
|
15
15
|
var probe = PhysicsToolSupport.ResolveReflectionProbe(r.Target); if (probe == null) throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_NOT_FOUND", "ReflectionProbe not found: " + r.Target, "Pass an existing ReflectionProbe target.");
|
|
@@ -28,7 +28,7 @@ namespace UnityCli
|
|
|
28
28
|
if (!exr) throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_BAKE_ARTIFACT_INVALID", "Bake did not write a valid EXR artifact.", "Use an .exr output path.");
|
|
29
29
|
if (oldExists && oldDigest == digest) throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_BAKE_ARTIFACT_UNPROVEN", "The EXR digest did not change, so this bake cannot be attributed to this request.", "Choose a new output path or remove the old artifact before retrying.");
|
|
30
30
|
if (info.LastWriteTimeUtc < started || info.Length != bytes.LongLength) throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_BAKE_ARTIFACT_UNPROVEN", "The EXR metadata cannot be attributed to this request.", "Choose a new output path and retry.");
|
|
31
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { Probe = GraphicsToolSupport.BuildReflectionProbeInfo(probe), Baked = true, ArtifactPath = outputPath, SizeBytes = bytes.LongLength, Sha256 = digest, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "
|
|
31
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { Probe = GraphicsToolSupport.BuildReflectionProbeInfo(probe), Baked = true, ArtifactPath = outputPath, SizeBytes = bytes.LongLength, Sha256 = digest, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "lighting.bake.reflection-probe", Property = "probe", Value = GameObjectToolSupport.HierarchyPath(probe.gameObject) } } });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -6,12 +6,12 @@ using UnityEngine.SceneManagement;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.bake.settings — 读取/写入 LightingSettings。</summary>
|
|
10
|
+
public class LightingBakeSettingsTool : IUnityCliTool<LightingBakeSettingsTool.Request, LightingBakeSettingsTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { public string Scene { get; set; } public string LightingMode { get; set; } public bool? BakedGI { get; set; } public bool? RealtimeGI { get; set; } public int? DirectSamples { get; set; } public int? IndirectSamples { get; set; } public int? EnvironmentSamples { get; set; } public int? Bounces { get; set; } public string Filtering { get; set; } }
|
|
13
13
|
public sealed class Result { public LightingSettingsInfo Settings { get; set; } public string ScenePath { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.settings", Summary = "Read or update LightingSettings for a scene.", Description = "Read or write LightingSettings (lightingMode, bakedGI, realtimeGI, samples, bounces, filtering). scene defaults to the active scene.", Group = "lighting", DestructiveHint = true, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read bake settings", Input = new Request { } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var scene = ResolveLightingScene(r.Scene);
|
|
@@ -26,7 +26,7 @@ namespace UnityCli
|
|
|
26
26
|
var filtering = string.IsNullOrEmpty(r.Filtering) ? (LightingSettings.FilterType?)null : GraphicsToolSupport.ParseEnum<LightingSettings.FilterType>(r.Filtering, "filtering");
|
|
27
27
|
if ((r.DirectSamples.HasValue && r.DirectSamples.Value <= 0) || (r.IndirectSamples.HasValue && r.IndirectSamples.Value <= 0) || (r.EnvironmentSamples.HasValue && r.EnvironmentSamples.Value <= 0) || (r.Bounces.HasValue && r.Bounces.Value < 0)) throw new UnityCliBridge.BridgeCommandException("E_BAKE_SETTINGS_RANGE_INVALID", "Bake samples must be positive and bounces non-negative.", "Pass valid bake sample and bounce values.");
|
|
28
28
|
if (hasWrite) ctx.CommitEffect();
|
|
29
|
-
if (ls == null && hasWrite) { ls = new LightingSettings(); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
29
|
+
if (ls == null && hasWrite) { ls = new LightingSettings(); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "lightingSettings", Value = "created" }); }
|
|
30
30
|
if (ls != null)
|
|
31
31
|
{
|
|
32
32
|
if (!string.IsNullOrEmpty(r.LightingMode))
|
|
@@ -36,15 +36,15 @@ namespace UnityCli
|
|
|
36
36
|
#else
|
|
37
37
|
ls.mixedBakeMode = lightingMode.Value;
|
|
38
38
|
#endif
|
|
39
|
-
effects.Add(new GraphicsPlannedEffect { Type = "
|
|
39
|
+
effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "lightingMode", Value = r.LightingMode });
|
|
40
40
|
}
|
|
41
|
-
if (r.BakedGI.HasValue) { ls.bakedGI = r.BakedGI.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
42
|
-
if (r.RealtimeGI.HasValue) { ls.realtimeGI = r.RealtimeGI.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
43
|
-
if (r.DirectSamples.HasValue) { SetDirectSamples(ls, r.DirectSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
44
|
-
if (r.IndirectSamples.HasValue) { SetIndirectSamples(ls, r.IndirectSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
45
|
-
if (r.EnvironmentSamples.HasValue) { SetEnvSamples(ls, r.EnvironmentSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
46
|
-
if (r.Bounces.HasValue) { SetBounces(ls, r.Bounces.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
47
|
-
if (filtering.HasValue) { SetFiltering(ls, filtering.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
41
|
+
if (r.BakedGI.HasValue) { ls.bakedGI = r.BakedGI.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "bakedGI", Value = r.BakedGI.Value.ToString().ToLowerInvariant() }); }
|
|
42
|
+
if (r.RealtimeGI.HasValue) { ls.realtimeGI = r.RealtimeGI.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "realtimeGI", Value = r.RealtimeGI.Value.ToString().ToLowerInvariant() }); }
|
|
43
|
+
if (r.DirectSamples.HasValue) { SetDirectSamples(ls, r.DirectSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "directSamples", Value = r.DirectSamples.Value.ToString() }); }
|
|
44
|
+
if (r.IndirectSamples.HasValue) { SetIndirectSamples(ls, r.IndirectSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "indirectSamples", Value = r.IndirectSamples.Value.ToString() }); }
|
|
45
|
+
if (r.EnvironmentSamples.HasValue) { SetEnvSamples(ls, r.EnvironmentSamples.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "environmentSamples", Value = r.EnvironmentSamples.Value.ToString() }); }
|
|
46
|
+
if (r.Bounces.HasValue) { SetBounces(ls, r.Bounces.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "bounces", Value = r.Bounces.Value.ToString() }); }
|
|
47
|
+
if (filtering.HasValue) { SetFiltering(ls, filtering.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.bake.settings", Property = "filtering", Value = r.Filtering }); }
|
|
48
48
|
if (hasWrite)
|
|
49
49
|
{
|
|
50
50
|
Lightmapping.SetLightingSettingsForScene(scene, ls);
|
|
@@ -6,21 +6,21 @@ using UnityEngine.SceneManagement;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.bake.start — 异步启动光照烘焙。</summary>
|
|
10
|
+
public class LightingBakeStartTool : IUnityCliTool<LightingBakeStartTool.Request, LightingBakeStartTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { }
|
|
13
13
|
public sealed class Result { public bool Baking { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.start", Summary = "Start asynchronous lightmap baking.", Description = "Start Lightmapping.BakeAsync. Returns error if a bake is already running.", Group = "lighting",DestructiveHint = true, SideEffects = new[] { "bake" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Start baking", Input = new Request { } } } };
|
|
15
15
|
public async System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
|
-
if (Lightmapping.isRunning) throw new UnityCliBridge.BridgeCommandException("E_BAKE_ALREADY_RUNNING", "Lightmapping bake is already running.", "Run tools run
|
|
17
|
+
if (Lightmapping.isRunning) throw new UnityCliBridge.BridgeCommandException("E_BAKE_ALREADY_RUNNING", "Lightmapping bake is already running.", "Run tools run lighting.bake.status to inspect progress or lighting.bake.cancel to stop it.");
|
|
18
18
|
ctx.CommitEffect();
|
|
19
19
|
Lightmapping.BakeAsync();
|
|
20
20
|
var observed = await ctx.Wait.UntilStable(() => Lightmapping.isRunning, System.TimeSpan.FromMilliseconds(ctx.TimeoutMs), ct: ct);
|
|
21
21
|
if (!observed) throw new UnityCliBridge.BridgeCommandException("E_BAKE_START_TIMEOUT", "Lightmapping did not enter the baking state before timeout.", "Check Lighting settings and Unity Console, then retry.");
|
|
22
22
|
var baking = Lightmapping.isRunning;
|
|
23
|
-
return new Result { Baking = baking, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "
|
|
23
|
+
return new Result { Baking = baking, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "lighting.bake.start", Property = "bake", Value = "async" } } };
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -6,12 +6,12 @@ using UnityEngine.SceneManagement;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.bake.status — 读取光照烘焙状态。</summary>
|
|
10
|
+
public class LightingBakeStatusTool : IUnityCliTool<LightingBakeStatusTool.Request, LightingBakeStatusTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { }
|
|
13
13
|
public sealed class Result { public bool Baking { get; set; } public double Progress { get; set; } public BakeModeInfo Mode { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.bake.status", Summary = "Read lightmap baking progress and mode.", Description = "Read-only: returns baking state, progress (0-1), and lighting mode.", Group = "lighting",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Check bake status", Input = new Request { } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
#if UNITY_2023_2_OR_NEWER
|
|
@@ -7,18 +7,18 @@ using UnityEngine.Rendering;
|
|
|
7
7
|
|
|
8
8
|
namespace UnityCli
|
|
9
9
|
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
public class
|
|
10
|
+
/// <summary>lighting.light-probe-group — 管理 LightProbeGroup 组件与探针位置。</summary>
|
|
11
|
+
public class LightingLightProbeGroupTool : IUnityCliTool<LightingLightProbeGroupTool.Request, LightingLightProbeGroupTool.Result>
|
|
12
12
|
{
|
|
13
13
|
public sealed class Request { public string Target { get; set; } public bool? Create { get; set; } public string Positions { get; set; } }
|
|
14
14
|
public sealed class Result { public GraphicsProbeTarget Target { get; set; } public long ProbeCount { get; set; } public List<Vector3Data> Positions { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
15
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
15
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.light-probe-group", Summary = "Read, create, or set one LightProbeGroup's probe positions.", Description = "Dedicated LightProbeGroup Tool for Edit and Play mode. Resolve one target, set create=true to add the object/component when missing, and pass positions as space-separated x,y,z vectors to replace the array. Success re-resolves the component and returns fresh target identity, probe count, and positions.", Group = "lighting",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read light probe positions", Input = new Request { Target = "LightProbes" } }, new ToolExample { Description = "Set two light probe positions", Input = new Request { Target = "LightProbes", Positions = "0,0,0 0,2,0" } } } };
|
|
16
16
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
17
17
|
{
|
|
18
18
|
var createdObject = string.IsNullOrEmpty(r.Target);
|
|
19
19
|
if (createdObject && r.Create != true)
|
|
20
|
-
throw new UnityCliBridge.BridgeCommandException("E_LIGHT_PROBE_GROUP_TARGET_REQUIRED", "
|
|
21
|
-
var go = createdObject ? null : GameObjectToolSupport.ResolveUniqueTarget(r.Target, "
|
|
20
|
+
throw new UnityCliBridge.BridgeCommandException("E_LIGHT_PROBE_GROUP_TARGET_REQUIRED", "lighting.light-probe-group requires target unless create is true.", "Pass a target or set create=true.");
|
|
21
|
+
var go = createdObject ? null : GameObjectToolSupport.ResolveUniqueTarget(r.Target, "lighting.light-probe-group requires --target or create a new one.");
|
|
22
22
|
var positions = string.IsNullOrEmpty(r.Positions) ? null : GraphicsToolSupport.ParseVector3Array(r.Positions);
|
|
23
23
|
var probe = go == null ? null : go.GetComponent<LightProbeGroup>();
|
|
24
24
|
if (!createdObject && probe == null && r.Create != true)
|
|
@@ -36,8 +36,8 @@ namespace UnityCli
|
|
|
36
36
|
if (addComponent) probe = UnityCliSceneMutation.AddComponent<LightProbeGroup>(go);
|
|
37
37
|
}
|
|
38
38
|
var effects = new List<GraphicsPlannedEffect>();
|
|
39
|
-
if (addComponent) effects.Add(new GraphicsPlannedEffect { Type = "
|
|
40
|
-
if (positions != null) { UnityCliSceneMutation.RecordObject(probe, "Set light probe positions"); probe.probePositions = positions; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
39
|
+
if (addComponent) effects.Add(new GraphicsPlannedEffect { Type = "lighting.light-probe-group", Property = "component", Value = "added" });
|
|
40
|
+
if (positions != null) { UnityCliSceneMutation.RecordObject(probe, "Set light probe positions"); probe.probePositions = positions; effects.Add(new GraphicsPlannedEffect { Type = "lighting.light-probe-group", Property = "probePositions", Value = positions.Length.ToString() }); }
|
|
41
41
|
if (mutates) { UnityCliSceneMutation.MarkSceneObjectDirty(probe); UnityCliSceneMutation.MarkSceneDirty(go.scene); }
|
|
42
42
|
var observedObject = GameObjectToolSupport.ResolveUniqueTarget(go.GetInstanceID().ToString(CultureInfo.InvariantCulture), "LightProbeGroup could not be re-resolved after mutation.");
|
|
43
43
|
var observedProbe = observedObject.GetComponent<LightProbeGroup>();
|
|
@@ -8,18 +8,18 @@ using UnityEngine.Rendering;
|
|
|
8
8
|
|
|
9
9
|
namespace UnityCli
|
|
10
10
|
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
public class
|
|
11
|
+
/// <summary>lighting.reflection-probe — 管理 ReflectionProbe 组件。</summary>
|
|
12
|
+
public class LightingReflectionProbeTool : IUnityCliTool<LightingReflectionProbeTool.Request, LightingReflectionProbeTool.Result>
|
|
13
13
|
{
|
|
14
14
|
public sealed class Request { public string Target { get; set; } public bool? Create { get; set; } public string Mode { get; set; } public int? Resolution { get; set; } public int? Bounces { get; set; } public bool? Hdr { get; set; } public string BoxSize { get; set; } public string BoxOffset { get; set; } }
|
|
15
15
|
public sealed class Result { public GraphicsProbeTarget Target { get; set; } public ReflectionProbeInfo Probe { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
16
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
16
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.reflection-probe", Summary = "Read, create, or configure one ReflectionProbe component.", Description = "Dedicated ReflectionProbe Tool for Edit and Play mode. Resolve one target, set create=true to add the object/component when missing, and configure mode, resolution, bounces, hdr, boxSize, or boxOffset. Success re-resolves the component and returns fresh target identity and probe state.", Group = "lighting",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read reflection probe", Input = new Request { Target = "ReflectionProbe" } } } };
|
|
17
17
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
18
18
|
{
|
|
19
19
|
var createdObject = string.IsNullOrEmpty(r.Target);
|
|
20
20
|
if (createdObject && r.Create != true)
|
|
21
|
-
throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_TARGET_REQUIRED", "
|
|
22
|
-
var go = createdObject ? null : GameObjectToolSupport.ResolveUniqueTarget(r.Target, "
|
|
21
|
+
throw new UnityCliBridge.BridgeCommandException("E_REFLECTION_PROBE_TARGET_REQUIRED", "lighting.reflection-probe requires target unless create is true.", "Pass a target or set create=true.");
|
|
22
|
+
var go = createdObject ? null : GameObjectToolSupport.ResolveUniqueTarget(r.Target, "lighting.reflection-probe requires --target or create a new one.");
|
|
23
23
|
var mode = default(UnityEngine.Rendering.ReflectionProbeMode);
|
|
24
24
|
var hasMode = !string.IsNullOrEmpty(r.Mode);
|
|
25
25
|
if (hasMode && (!Enum.TryParse<UnityEngine.Rendering.ReflectionProbeMode>(r.Mode, true, out mode) || !Enum.IsDefined(typeof(UnityEngine.Rendering.ReflectionProbeMode), mode)))
|
|
@@ -44,14 +44,14 @@ namespace UnityCli
|
|
|
44
44
|
if (addComponent) probe = UnityCliSceneMutation.AddComponent<ReflectionProbe>(go);
|
|
45
45
|
}
|
|
46
46
|
var effects = new List<GraphicsPlannedEffect>();
|
|
47
|
-
if (addComponent) effects.Add(new GraphicsPlannedEffect { Type = "
|
|
47
|
+
if (addComponent) effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "component", Value = "added" });
|
|
48
48
|
if (mutates) UnityCliSceneMutation.RecordObject(probe, "Configure ReflectionProbe");
|
|
49
|
-
if (hasMode) { probe.mode = mode; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
50
|
-
if (r.Resolution.HasValue) { probe.resolution = r.Resolution.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
51
|
-
if (r.Bounces.HasValue) { SetBounces(probe, r.Bounces.Value); effects.Add(new GraphicsPlannedEffect { Type = "
|
|
52
|
-
if (r.Hdr.HasValue) { probe.hdr = r.Hdr.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
53
|
-
if (boxSize.HasValue) { probe.size = boxSize.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
54
|
-
if (boxOffset.HasValue) { probe.center = boxOffset.Value; effects.Add(new GraphicsPlannedEffect { Type = "
|
|
49
|
+
if (hasMode) { probe.mode = mode; effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "mode", Value = probe.mode.ToString() }); }
|
|
50
|
+
if (r.Resolution.HasValue) { probe.resolution = r.Resolution.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "resolution", Value = probe.resolution.ToString() }); }
|
|
51
|
+
if (r.Bounces.HasValue) { SetBounces(probe, r.Bounces.Value); effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "bounces", Value = r.Bounces.Value.ToString() }); }
|
|
52
|
+
if (r.Hdr.HasValue) { probe.hdr = r.Hdr.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "hdr", Value = probe.hdr.ToString().ToLowerInvariant() }); }
|
|
53
|
+
if (boxSize.HasValue) { probe.size = boxSize.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "boxSize", Value = probe.size.ToString() }); }
|
|
54
|
+
if (boxOffset.HasValue) { probe.center = boxOffset.Value; effects.Add(new GraphicsPlannedEffect { Type = "lighting.reflection-probe", Property = "boxOffset", Value = probe.center.ToString() }); }
|
|
55
55
|
if (mutates) { UnityCliSceneMutation.MarkSceneObjectDirty(probe); UnityCliSceneMutation.MarkSceneDirty(go.scene); }
|
|
56
56
|
var observedObject = GameObjectToolSupport.ResolveUniqueTarget(go.GetInstanceID().ToString(CultureInfo.InvariantCulture), "ReflectionProbe could not be re-resolved after mutation.");
|
|
57
57
|
var observedProbe = observedObject.GetComponent<ReflectionProbe>();
|
|
@@ -6,12 +6,12 @@ using UnityEngine.Rendering;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
public class
|
|
9
|
+
/// <summary>lighting.skybox.get — 读取天空盒/环境/雾/反射设置。</summary>
|
|
10
|
+
public class LightingSkyboxGetTool : IUnityCliTool<LightingSkyboxGetTool.Request, LightingSkyboxGetTool.Result>
|
|
11
11
|
{
|
|
12
12
|
public sealed class Request { }
|
|
13
13
|
public sealed class Result { public SkyboxInfo Skybox { get; set; } }
|
|
14
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
14
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.skybox.get", Summary = "Read skybox material, sun, ambient, fog and reflection environment settings.", Description = "Read-only: returns RenderSettings skybox, sun, ambient mode/intensity/color, fog settings, and reflection settings.", Group = "lighting",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read skybox settings", Input = new Request { } } } };
|
|
15
15
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
16
16
|
{
|
|
17
17
|
var skybox = RenderSettings.skybox;
|
package/unitypkg/Editor/Tools/{graphics/skybox-set-ambient.cs → lighting/skybox/set-ambient.cs}
RENAMED
|
@@ -4,11 +4,11 @@ using UnityEngine;
|
|
|
4
4
|
using UnityEngine.Rendering;
|
|
5
5
|
namespace UnityCli
|
|
6
6
|
{
|
|
7
|
-
public class
|
|
7
|
+
public class LightingSkyboxSetAmbientTool : IUnityCliTool<LightingSkyboxSetAmbientTool.Request, LightingSkyboxSetAmbientTool.Result>
|
|
8
8
|
{
|
|
9
9
|
public sealed class Request { public string Mode { get; set; } public float? Intensity { get; set; } public string Color { get; set; } public string AmbientEquatorColor { get; set; } public string AmbientGroundColor { get; set; } public string AmbientSkyColor { get; set; } }
|
|
10
10
|
public sealed class Result { public string AmbientMode { get; set; } public double AmbientIntensity { get; set; } public List<GraphicsPlannedEffect> PlannedEffects { get; set; } }
|
|
11
|
-
public ToolDescriptor Describe() => new() { Name = "
|
|
11
|
+
public ToolDescriptor Describe() => new() { Name = "lighting.skybox.set-ambient", Summary = "Set ambient lighting.", Description = "Set RenderSettings ambient values.", Group = "lighting",SideEffects = new[] { "settings-write" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set flat ambient lighting", Input = new Request { Mode = "Flat", Intensity = 1f, Color = "#808080" } } } };
|
|
12
12
|
public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
|
|
13
13
|
{
|
|
14
14
|
AmbientMode? mode = string.IsNullOrEmpty(r.Mode) ? (AmbientMode?)null : GraphicsToolSupport.ParseEnum<AmbientMode>(r.Mode, "mode");
|
|
@@ -17,7 +17,7 @@ namespace UnityCli
|
|
|
17
17
|
if (!mode.HasValue && !intensity.HasValue && !color.HasValue && !equator.HasValue && !ground.HasValue && !sky.HasValue) return new System.Threading.Tasks.ValueTask<Result>(new Result { AmbientMode = RenderSettings.ambientMode.ToString(), AmbientIntensity = RenderSettings.ambientIntensity, PlannedEffects = new List<GraphicsPlannedEffect>() });
|
|
18
18
|
ctx.CommitEffect(); if (mode.HasValue) RenderSettings.ambientMode = mode.Value; if (intensity.HasValue) RenderSettings.ambientIntensity = intensity.Value; if (color.HasValue) RenderSettings.ambientLight = color.Value; if (equator.HasValue) RenderSettings.ambientEquatorColor = equator.Value; if (ground.HasValue) RenderSettings.ambientGroundColor = ground.Value; if (sky.HasValue) RenderSettings.ambientSkyColor = sky.Value;
|
|
19
19
|
if ((mode.HasValue && RenderSettings.ambientMode != mode.Value) || (intensity.HasValue && !Mathf.Approximately(RenderSettings.ambientIntensity, intensity.Value)) || (color.HasValue && !GraphicsToolSupport.SameColor(RenderSettings.ambientLight, color.Value)) || (equator.HasValue && !GraphicsToolSupport.SameColor(RenderSettings.ambientEquatorColor, equator.Value)) || (ground.HasValue && !GraphicsToolSupport.SameColor(RenderSettings.ambientGroundColor, ground.Value)) || (sky.HasValue && !GraphicsToolSupport.SameColor(RenderSettings.ambientSkyColor, sky.Value))) throw new UnityCliBridge.BridgeCommandException("E_AMBIENT_STATE_MISMATCH", "Ambient settings readback did not match the request.", "Retry after the editor is idle.");
|
|
20
|
-
return new System.Threading.Tasks.ValueTask<Result>(new Result { AmbientMode = RenderSettings.ambientMode.ToString(), AmbientIntensity = RenderSettings.ambientIntensity, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "
|
|
20
|
+
return new System.Threading.Tasks.ValueTask<Result>(new Result { AmbientMode = RenderSettings.ambientMode.ToString(), AmbientIntensity = RenderSettings.ambientIntensity, PlannedEffects = new List<GraphicsPlannedEffect> { new GraphicsPlannedEffect { Type = "lighting.skybox.set-ambient", Property = "ambient", Value = "updated" } } });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|