Skip to content

Commit 8e53ce5

Browse files
committed
Add UITK click support for V3 smoke
1 parent 2ed9393 commit 8e53ce5

20 files changed

Lines changed: 351 additions & 16 deletions

File tree

docs/ref/ai-quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Open (or restart) the Unity Editor after running this command. For contributor w
2323

2424
```bash
2525
unityctl init --project "/path/to/unity/project" --source /path/to/unityctl/src/Unityctl.Plugin
26-
unityctl init --project "/path/to/unity/project" --source "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.5"
26+
unityctl init --project "/path/to/unity/project" --source "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.6"
2727
```
2828

2929
### 3. Verify
@@ -112,7 +112,7 @@ For small artifact-first verification bundles, `workflow verify` now supports `p
112112
For UGUI interactions beyond toggle/input, use `ui scroll`, `ui slider-set`, `ui dropdown-set` to set ScrollRect/Slider/Dropdown values deterministically.
113113
For URP/HDRP projects, `volume list/get/get-overrides/set-override` and `renderer-feature list` inspect and modify Volume overrides via Reflection (no hard dependency on URP/HDRP).
114114
For Cinemachine, `cinemachine list/get/set-property` supports both 2.x and 3.x with runtime auto-detection.
115-
For UI Toolkit, `uitk find/get/set-value` queries and modifies UIDocument elements at runtime.
115+
For UI Toolkit, `uitk find/get/set-value/click` queries and interacts with UIDocument elements at runtime.
116116
For animation workflows, `animation list-clips/get-clip/get-controller/add-curve` inspect and edit AnimationClips and AnimatorControllers.
117117
For profiling, `profiler get-stats/start/stop` provides memory and performance statistics (full rendering stats require Play Mode).
118118

docs/ref/getting-started.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ If you need a contributor-style source install instead, you can still do one of
7979

8080
```bash
8181
unityctl init --project /path/to/unity/project --source /path/to/unityctl/src/Unityctl.Plugin
82-
unityctl init --project /path/to/unity/project --source "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.5"
82+
unityctl init --project /path/to/unity/project --source "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.6"
8383
```
8484

8585
When switching away from an older `file:` install, first run:
@@ -398,9 +398,12 @@ unityctl uitk set-value --project /path/to/project --name "myTextField" --value
398398
399399
# Or set by locator
400400
unityctl uitk set-value --project /path/to/project --locator "MainHud::root/1:TextField#Name" --value "hello" --json
401+
402+
# Click a Button-like UITK element in Play Mode
403+
unityctl uitk click --project /path/to/project --name "myButton" --mode play --json
401404
```
402405
403-
`uitk find`, `uitk get`, and `uitk set-value` now share the same resolver. Prefer the returned `locator` when multiple elements share the same `name`.
406+
`uitk find`, `uitk get`, `uitk set-value`, and `uitk click` share the same resolver. Prefer the returned `locator` when multiple elements share the same `name`.
404407
405408
### Script Management
406409

docs/ref/phase-roadmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Phase C — Profiler Commands (get-stats/start/stop 3개 명령) ✅ 완료
7373
Phase I-1 — UGUI Enhancement (ui-scroll/slider-set/dropdown-set 3개 명령) ✅ 완료
7474
Phase D — Volume/PostProcessing (volume 4개 + renderer-feature 1개 = 5개 명령, Reflection) ✅ 완료
7575
Phase E — Cinemachine (list/get/set-property 3개 명령, 2.x/3.x auto-detect) ✅ 완료
76-
Phase I-2 — UI Toolkit (uitk-find/get/set-value 3개 명령, runtime capability) ✅ 완료
76+
Phase I-2 — UI Toolkit (uitk-find/get/set-value/click 4개 명령, runtime capability) ✅ 완료
7777
Marketplace — mcp.so + PulseMCP 등록 ✅ 완료
7878
```
7979

@@ -123,7 +123,7 @@ Marketplace — mcp.so + PulseMCP 등록 ✅ 완료
123123
| **Phase I-1: UGUI Enhancement** | ui-scroll (ScrollRect), slider-set (Slider), dropdown-set (Dropdown), PrefabGuard+UndoScope ||
124124
| **Phase D: Volume/PostProcessing** | volume-list/get/set-override/get-overrides (Reflection, no URP/HDRP hard dep), renderer-feature-list ||
125125
| **Phase E: Cinemachine** | cinemachine-list/get/set-property, 2.x/3.x auto-detect, SerializedObject property editing ||
126-
| **Phase I-2: UI Toolkit** | uitk-find/get/set-value, runtime UIDocument capability check, element tree traversal ||
126+
| **Phase I-2: UI Toolkit** | uitk-find/get/set-value/click, runtime UIDocument capability check, element tree traversal ||
127127
| **Marketplace** | mcp.so + PulseMCP 등록 완료 ||
128128

129129
---

docs/status/PHASE-EXECUTION-BOARD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
| Phase I-1: UGUI Enhancement | ui-scroll/slider-set/dropdown-set (3개 명령) | P1 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
4949
| Phase D: Volume/PostProcessing | volume-list/get/set-override/get-overrides + renderer-feature-list (5개 명령, Reflection) | P1 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
5050
| Phase E: Cinemachine | cinemachine-list/get/set-property (3개 명령, 2.x/3.x auto-detect) | P2 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
51-
| Phase I-2: UI Toolkit | uitk-find/get/set-value (3개 명령, runtime capability check) | P2 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
51+
| Phase I-2: UI Toolkit | uitk-find/get/set-value/click (4개 명령, runtime capability check) | P2 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
5252
| Marketplace Registration | mcp.so + PulseMCP 등록 | P0 | Done || 2026-03-20 |
5353
| MCP Prompts | create_game_scene/debug_game/iterate_gameplay/setup_project (4개 AI 워크플로우) | P1 | Done | docs/ref/phase-roadmap.md | 2026-03-20 |
5454
| CLI Feedback Fixes | prefab-instantiate + asset copy 외부 경로 + IPC 30초 메시지 타임아웃 (CLI-012/014/000) | P0 | Done | docs/status/FEATURE-BACKLOG.md | 2026-03-20 |

docs/status/PROJECT-STATUS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
- **Phase I-1: UGUI Enhancement (ui-scroll/slider-set/dropdown-set — 3개 명령)**: 구현 완료
4646
- **Phase D: Volume/PostProcessing (volume-list/get/set-override/get-overrides, renderer-feature-list — 5개 명령)**: 구현 완료
4747
- **Phase E: Cinemachine (cinemachine-list/get/set-property — 3개 명령, capability gating)**: 구현 완료
48-
- **Phase I-2: UI Toolkit (uitk-find/get/set-value — 3개 명령, runtime capability check)**: 구현 완료
48+
- **Phase I-2: UI Toolkit (uitk-find/get/set-value/click4개 명령, runtime capability check)**: 구현 완료
4949

5050
- **MCP Prompts (create_game_scene, debug_game, iterate_gameplay, setup_project — 4개 AI 워크플로우 프롬프트)**: 구현 완료
5151
- **CLI Feedback Fixes (CLI-012 prefab-instantiate, CLI-014 asset copy 외부 경로, CLI-000 IPC 30초 메시지 타임아웃)**: 구현 완료. Unity 6 라이브 테스트 통과.
@@ -55,7 +55,7 @@
5555
- **CLI Enhancement (profiler rendering stats + component add --name + component enable/disable + profiler --detailed)**: 구현 완료. Unity 6 라이브 테스트 통과. 755 테스트 통과.
5656
- **Real-World UX Hardening (`await-ready` interactive gating, headless process classification, `exec` parser hardening, UITK locator resolver, scene dirty policy)**: 구현 완료. `My project` 기준 라이브 검증/통합 테스트 통과.
5757

58-
**전체 Phase 완료. 총 84개 write allowlist 명령, 159개 CLI 명령 (+2 component enable/disable), 12개 MCP 도구 (33→12 통합), 4개 MCP 프롬프트.**
58+
**전체 Phase 완료. 총 85개 write allowlist 명령, 160개 CLI 명령 (+2 component enable/disable), 12개 MCP 도구 (33→12 통합), 4개 MCP 프롬프트.**
5959

6060
## Real-World UX Hardening 라이브 검증 (My project, 2026-04-06)
6161

@@ -76,7 +76,7 @@
7676
- Windows 프로세스 탐지에서 `headless` vs `interactive`를 구분한다.
7777
- `await-ready`는 interactive Editor가 없으면 IPC-ready를 기다리지 않는다.
7878
- `exec --code``Type.Member`, `Type.Member = value`, `Type.Method(args...)` 미니 DSL로 정식화했다.
79-
- `uitk find/get/set-value` 공통 locator resolver를 쓴다.
79+
- `uitk find/get/set-value/click` 공통 locator resolver를 쓴다.
8080
- `scene open/create``dirtyPolicy=fail|save|discard`를 지원한다.
8181

8282
## Visual Verification v2 Phase 1 라이브 검증 (My project, Unity 6000.0.64f1)

src/Unityctl.Cli/Commands/UitkCommand.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ public static void SetValue(string project, string value, string? name = null, s
2424
CommandRunner.Execute(project, request, json);
2525
}
2626

27+
public static void Click(string project, string? name = null, string? locator = null, string mode = "auto", bool json = false)
28+
{
29+
var request = CreateClickRequest(name, locator, mode);
30+
var exitCode = UiCommand.ExecuteInteractiveAsync(project, request, json).GetAwaiter().GetResult();
31+
Environment.Exit(exitCode);
32+
}
33+
2734
internal static CommandRequest CreateFindRequest(string? name, string? className, string? type, int? limit)
2835
{
2936
var parameters = new JsonObject();
@@ -79,4 +86,25 @@ internal static CommandRequest CreateSetValueRequest(string value, string? name
7986
Parameters = parameters
8087
};
8188
}
89+
90+
internal static CommandRequest CreateClickRequest(string? name = null, string? locator = null, string mode = "auto")
91+
{
92+
if (string.IsNullOrWhiteSpace(name) && string.IsNullOrWhiteSpace(locator))
93+
throw new ArgumentException("name or locator must not be empty");
94+
95+
var parameters = new JsonObject
96+
{
97+
["mode"] = UiCommand.ParseInteractionMode(mode, nameof(mode))
98+
};
99+
if (!string.IsNullOrWhiteSpace(name))
100+
parameters["name"] = name;
101+
if (!string.IsNullOrWhiteSpace(locator))
102+
parameters["locator"] = locator;
103+
104+
return new CommandRequest
105+
{
106+
Command = WellKnownCommands.UitkClick,
107+
Parameters = parameters
108+
};
109+
}
82110
}

src/Unityctl.Cli/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@
523523
app.Add("uitk set-value", (string project, string value, string? name = null, string? locator = null, bool json = false) =>
524524
UitkCommand.SetValue(project, value, name, locator, json));
525525

526+
app.Add("uitk click", (string project, string? name = null, string? locator = null, string mode = "auto", bool json = false) =>
527+
UitkCommand.Click(project, name, locator, mode, json));
528+
526529
// Cinemachine — Phase E
527530
app.Add("cinemachine list", (string project, bool includeInactive = false, bool json = false) =>
528531
CinemachineCommand.List(project, includeInactive, json));

src/Unityctl.Mcp/Prompts/GameWorkflowPrompts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ 2. Confirm Unity Editor is open with the target project
155155
## Step 2: Install Plugin
156156
3. unityctl_run(command="init") with parameters:
157157
- project: "/path/to/unity/project"
158-
- source: "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.5"
158+
- source: "https://github.com/Jason-hub-star/unityctl.git?path=/src/Unityctl.Plugin#v0.3.6"
159159
4. Restart Unity Editor (or wait for domain reload)
160160
161161
## Step 3: Verify

src/Unityctl.Mcp/Tools/RunTool.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ internal sealed class RunTool(CommandExecutor executor)
104104
WellKnownCommands.ScriptableObjectSetProperty,
105105
// UI Toolkit — Phase I-2
106106
WellKnownCommands.UitkSetValue,
107+
WellKnownCommands.UitkClick,
107108
// Cinemachine — Phase E
108109
WellKnownCommands.CinemachineSetProperty,
109110
// Volume/PostProcessing — Phase D

src/Unityctl.Plugin/Editor/Commands/PingHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public CommandResponse Execute(CommandRequest request)
1111
{
1212
var data = new JObject
1313
{
14-
["version"] = "0.3.5",
14+
["version"] = "0.3.6",
1515
#if UNITY_EDITOR
1616
["unityVersion"] = UnityEngine.Application.unityVersion
1717
#endif

0 commit comments

Comments
 (0)