本文へ移動
cccskills
無料GitHub で公開

uloop-uitk-interact

Interact with UI Toolkit (UXML/USS) runtime UI in PlayMode. Use INSTEAD OF uloop-simulate-mouse-ui / uloop-simulate-mouse-input whenever the target UI is UI Toolkit — those tools only reach uGUI and report 'no UI element hit' or silently do nothing on UI Toolkit panels.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

UI Toolkit UIの操作・検証(uloop回避策スキル)

背景(なぜこのスキルが必要か)

uloop-cli 2.2.0 + Unity 6000.4.5f1 で実測した制約:

  1. simulate-mouse-input(Mouse.current注入)は Success=true でも UI Toolkit の Button.clicked が発火しない
  2. simulate-mouse-ui は EventSystem + InputSystemUIInputModule + PanelRaycaster が揃っていても「no UI element hit」になる(uGUI前提)
  3. screenshot --annotate-elements true は UI Toolkit 要素を検出しない(AnnotatedElements が空になる)
  4. screenshot --capture-mode rendering は UI Toolkit 要素が全てシアンの矩形に化ける

やり方

操作: execute-dynamic-code でUIイベントを直接送出する

.csx ファイルに C# を書いて実行する:

npx --yes uloop-cli@2.2.0 execute-dynamic-code --code-file <path>.csx --project-path <unity-project>

ボタンクリック(Button.clicked を発火させる標準形):

using UnityEngine;
using UnityEngine.UIElements;

var doc = Object.FindFirstObjectByType<UIDocument>();
var root = doc.rootVisualElement;
var button = root.Q<Button>("onigiri-button");   // name指定。classなら Query<Button>(className: "shop-buy").ToList()

using (var e = new NavigationSubmitEvent())
{
    e.target = button;
    button.SendEvent(e);
}
return "clicked: " + button.name;
  • 連打は for ループで囲む
  • Toggle/Slider等の値変更は element.value = x; で直接設定してよい(変更通知は using var ev = ChangeEvent<T>.GetPooled(old, new); ev.target = element; element.SendEvent(ev);)
  • 注意: System.IO や AssetDatabase.CreateFolder は execute-dynamic-code では禁止

状態検証: ラベル文字列をreturnで読み取る

スクショの目視より確実。操作と同じ .csx 内で実行結果を返す:

string count = root.Q<Label>("onigiri-count").text;
return $"count=[{count}]";

見た目検証: スクショは必ず window モードで撮る

npx --yes uloop-cli@2.2.0 screenshot --window-name Game --output-directory <dir> --project-path <unity-project>
  • --capture-mode rendering は使わない(UI Toolkitがシアン化して正しく評価できない)
  • windowモードはエディタのツールバーが写り込み、Game Viewの表示スケール(例: 0.85x)の影響を受ける点は承知の上で使う

ワークフロー例(クリック→状態→見た目の3点検証)

  1. control-play-mode --action Play でPlayMode開始(enum は Play/Stop/Pause。小文字は不可)
  2. .csx で SendEvent 操作 + ラベル値を return で確認
  3. screenshot --window-name Game で見た目を確認
  4. control-play-mode --action Stop

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

figma-make-prompt

無料日本語概要

Unityゲーム画面用のFigma Make(Figma AI)投入プロンプトを壁打ちで設計・生成する。UI Toolkit(UXML/USS)への変換を見据えた制約込み。ユーザーが「Figma用のプロンプトを作りたい」「画面デザインの壁打ちをしたい」と言ったら使う。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

uitk-import

無料日本語概要

デザイン(Figma MCP出力・HTML/CSS・デザイン仕様)からUI Toolkit用UXML/USSを生成し、Unityへのインポート・シーン配置・コンパイル・スクショ検証・ゲームロジック結線検証まで自動で行う。「この画面をUnityに取り込んで」「UXML/USSにして」で使う。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

Clear Unity Console entries. Use before compile, tests, or debugging when stale logs would hide the current result.

日本語の概要は準備中です。原文の説明を表示しています。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

Compile the Unity project and report errors/warnings. Use after C# edits or when a full Domain Reload compile is needed.

日本語の概要は準備中です。原文の説明を表示しています。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

Control Unity Editor Play Mode. Use to start, stop, or pause Play Mode for runtime behavior checks and frame inspection.

日本語の概要は準備中です。原文の説明を表示しています。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for scene, prefab, SerializedObject, AssetDatabase refresh/.meta generation, menu, or PlayMode automation.

日本語の概要は準備中です。原文の説明を表示しています。

41h0-siro/cedec2026-lt-ai-ui-workflow42026年7月23日 更新

41h0-siro のスキルをすべて見る

このスキルの問題を報告する