Unityゲーム画面用のFigma Make(Figma AI)投入プロンプトを壁打ちで設計・生成する。UI Toolkit(UXML/USS)への変換を見据えた制約込み。ユーザーが「Figma用のプロンプトを作りたい」「画面デザインの壁打ちをしたい」と言ったら使う。
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 で実測した制約:
simulate-mouse-input(Mouse.current注入)は Success=true でも UI Toolkit の Button.clicked が発火しないsimulate-mouse-uiは EventSystem + InputSystemUIInputModule + PanelRaycaster が揃っていても「no UI element hit」になる(uGUI前提)screenshot --annotate-elements trueは UI Toolkit 要素を検出しない(AnnotatedElements が空になる)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点検証)
control-play-mode --action PlayでPlayMode開始(enum はPlay/Stop/Pause。小文字は不可)- .csx で SendEvent 操作 + ラベル値を return で確認
screenshot --window-name Gameで見た目を確認control-play-mode --action Stop
レビュー
まだレビューはありません。使ってみた感想をお寄せください。
同じリポジトリのスキル
概要と使いどころ
デザイン(Figma MCP出力・HTML/CSS・デザイン仕様)からUI Toolkit用UXML/USSを生成し、Unityへのインポート・シーン配置・コンパイル・スクショ検証・ゲームロジック結線検証まで自動で行う。「この画面をUnityに取り込んで」「UXML/USSにして」で使う。
Clear Unity Console entries. Use before compile, tests, or debugging when stale logs would hide the current result.
日本語の概要は準備中です。原文の説明を表示しています。
Compile the Unity project and report errors/warnings. Use after C# edits or when a full Domain Reload compile is needed.
日本語の概要は準備中です。原文の説明を表示しています。
Control Unity Editor Play Mode. Use to start, stop, or pause Play Mode for runtime behavior checks and frame inspection.
日本語の概要は準備中です。原文の説明を表示しています。
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.
日本語の概要は準備中です。原文の説明を表示しています。