diff --git a/README.md b/README.md index 6fc9b3d3d..f7de481a0 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,63 @@ Unity CLI Loop is built around four core ideas: 3. **PlayMode automated testing — AI clicks buttons, drags elements, presses keys, replays recorded input, and verifies game behavior.** Uses `simulate-mouse-ui`, `simulate-mouse-input`, `simulate-keyboard`, `replay-input`, `execute-dynamic-code`, `screenshot`. 4. **Achieving the above with a minimal set of tools.** See [Design Philosophy](#design-philosophy). -https://github.com/user-attachments/assets/569a2110-7351-4cf3-8281-3a83fe181817 +# Demos + +Each clip is a real Claude Code session driving a small voxel game through `uloop`. Stretches where only the terminal changes are sped up; the game plays at real speed. + +## Launch Unity: `launch` + +`uloop launch` opens the project in the Unity version it specifies and returns once the Editor can take commands. + +https://github.com/user-attachments/assets/4e83a196-66a4-4f39-80fb-f33b7a038066 + +## Add a feature and test it: `compile`, `run-tests` + +Claude adds a glowing torch block, builds the project with `compile`, and runs the EditMode tests with `run-tests`. It fixes the test that fails, then checks the torch at night in Play Mode. + +https://github.com/user-attachments/assets/98bba49f-1846-4b8e-9702-733207e8318f + +## Change code during Play Mode: `hot-reload` + +Claude adds a double jump and applies it with `hot-reload` without leaving Play Mode, then presses Space with `simulate-keyboard` to measure the jump heights. + +https://github.com/user-attachments/assets/fdba761a-b65a-4297-92f1-5cb274f4c4cf + +## Stop on a line and read that frame: `pause-point` + +The first time water flows into a gap, `pause-point` stops the game on the line that decides a cell's new water level and returns that frame's local variables, fields, and call path. A watch expression then tracks the water level along the channel while the water advances one tick at a time. + +https://github.com/user-attachments/assets/99ef7b4a-b32f-4e75-9aa8-9e976f7b0078 + +## Run C# inside the game: `execute-dynamic-code` + +`execute-dynamic-code` runs C# in the running game. Claude stacks ten glass blocks in front of the player, then renders a wide shot of the tower from a temporary camera. + +https://github.com/user-attachments/assets/804d81bc-e019-4423-bfcd-089cd0e207c2 + +## Capture what the game shows: `screenshot` + +Claude finds the lake with `execute-dynamic-code`, moves the camera high above it, and captures the view with `screenshot`, then hides the HUD and takes the shot again. + +https://github.com/user-attachments/assets/da9302a6-7785-4b21-affa-e6f814094c48 + +## Read the scene: `get-hierarchy`, `find-game-objects` + +`get-hierarchy` saves the running scene's tree to a file, and `find-game-objects` reads the Player's components. + +https://github.com/user-attachments/assets/ccb960a9-fa8a-40d8-b72c-7e24e11d32c8 + +## Press keys: `simulate-keyboard` + +`simulate-keyboard` holds W through the Input System. The player walks off the bank into the lake, and a screenshot confirms the underwater view. + +https://github.com/user-attachments/assets/7b7abb7c-6d87-464e-b7d7-223109c27d30 + +## Move and click the mouse: `simulate-mouse-input` + +`simulate-mouse-input` moves the mouse gradually, the way a hand would, to break three blocks and fill the hole with water. + +https://github.com/user-attachments/assets/0ecf0876-8230-4b4d-b51a-fe72cf9ca4c7 # Quickstart diff --git a/README_ja.md b/README_ja.md index 61ce8e6dd..96e5e7253 100644 --- a/README_ja.md +++ b/README_ja.md @@ -35,7 +35,63 @@ Unity CLI Loopのコアとなるコンセプトは次の4つです。 3. **PlayMode中の自動テスト — ボタンクリック、ドラッグ、キーボード入力、記録済み入力の再生、ゲーム動作の検証をAIが実行** — `simulate-mouse-ui`, `simulate-mouse-input`, `simulate-keyboard`, `replay-input`, `execute-dynamic-code`, `screenshot` 4. **上記を最小限のツール数で実現する** → [設計思想](#設計思想) -https://github.com/user-attachments/assets/569a2110-7351-4cf3-8281-3a83fe181817 +# デモ + +どの動画も、Claude Code が `uloop` で小さなボクセルゲームを操作した実際のセッションです。ターミナルだけが動く区間は早送りし、ゲーム画面は実時間で再生しています。 + +## Unity を起動する:`launch` + +`uloop launch` は、プロジェクトが指定するバージョンの Unity でプロジェクトを開き、Editor がコマンドを受け付けられるようになるまで待ちます。 + +https://github.com/user-attachments/assets/4e83a196-66a4-4f39-80fb-f33b7a038066 + +## 機能を足してテストする:`compile`、`run-tests` + +Claude が光る松明ブロックを追加し、`compile` でビルドして、`run-tests` で EditMode テストを実行します。失敗したテストを直し、Play Mode で夜にして松明を確かめます。 + +https://github.com/user-attachments/assets/98bba49f-1846-4b8e-9702-733207e8318f + +## Play Mode のままコードを変える:`hot-reload` + +Claude が二段ジャンプを追加し、Play Mode を止めずに `hot-reload` で反映します。続けて `simulate-keyboard` で Space を押し、ジャンプの高さを測ります。 + +https://github.com/user-attachments/assets/fdba761a-b65a-4297-92f1-5cb274f4c4cf + +## 指定した行で止めて、そのフレームを読む:`pause-point` + +水が隙間へ初めて流れ込むとき、セルの新しい水位を決める行で `pause-point` がゲームを止め、そのフレームのローカル変数・フィールド・呼び出し経路を返します。続いてウォッチ式で水路の水位を追いながら、水を 1 tick ずつ進めます。 + +https://github.com/user-attachments/assets/99ef7b4a-b32f-4e75-9aa8-9e976f7b0078 + +## ゲームの中で C# を実行する:`execute-dynamic-code` + +`execute-dynamic-code` は実行中のゲームの中で C# を動かします。Claude がプレイヤーの前にガラスブロックを 10 個積み、一時的なカメラから塔全体を撮ります。 + +https://github.com/user-attachments/assets/804d81bc-e019-4423-bfcd-089cd0e207c2 + +## ゲーム画面を撮る:`screenshot` + +Claude が `execute-dynamic-code` で湖を探してカメラを真上に移し、`screenshot` で撮ります。そのあと HUD を隠して撮り直します。 + +https://github.com/user-attachments/assets/da9302a6-7785-4b21-affa-e6f814094c48 + +## シーンの構造を読む:`get-hierarchy`、`find-game-objects` + +`get-hierarchy` が実行中のシーンのツリーをファイルに保存し、`find-game-objects` がプレイヤーのコンポーネントを読みます。 + +https://github.com/user-attachments/assets/ccb960a9-fa8a-40d8-b72c-7e24e11d32c8 + +## キーを押す:`simulate-keyboard` + +`simulate-keyboard` が Input System 経由で W キーを押し続けます。プレイヤーは岸から湖に入り、スクリーンショットで水中の視界を確かめます。 + +https://github.com/user-attachments/assets/7b7abb7c-6d87-464e-b7d7-223109c27d30 + +## マウスを動かしてクリックする:`simulate-mouse-input` + +`simulate-mouse-input` が人の手のようにマウスを少しずつ動かし、ブロックを 3 つ壊して、できた穴を水で満たします。 + +https://github.com/user-attachments/assets/0ecf0876-8230-4b4d-b51a-fe72cf9ca4c7 # クイックスタート