Skip to content
cccskills
FreePublished on 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.

The English summary is being prepared. Showing the original description.

Works withUnity
See how to install

Files included (1)

  • SKILL.md3.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

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

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

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

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

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

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

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

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

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.

The English summary is being prepared. Showing the original description.

41h0-siro/cedec2026-lt-ai-ui-workflow4Updated Jul 23, 2026

See all skills by 41h0-siro

Report a problem with this skill