wait_for_selector
Poll until a GameObject matching a U-Selector (same syntax as query_objects) reaches a state, or until timeout. States: attached (exists, even inactive), detached (no match), visible (active in hierarchy and rendered/shown), hidden (no match or not visible), interactable (visible and accepts interaction). Use it after actions whose effect appears a few frames later, such as entering Play Mode or clicking UI, instead of sleeping. Returns the matched object’s path, or an error on timeout.
分類: 検索
| 名前 | 型 | 必須 | 既定値 | 説明 |
|---|---|---|---|---|
selector |
string | 必須 | U-Selector query string | |
state |
string | "visible" |
Expected state to wait for. 値: attached, detached, visible, hidden, interactable |
|
timeout |
number | 5 |
Maximum time to wait in seconds | |
poll_interval |
number | 0.1 |
Time between checks in seconds |
呼び出しの例
Section titled “呼び出しの例”必須の引数だけを入れています。ほかは必要に応じて足してください。
{ "name": "wait_for_selector", "arguments": { "selector": "…" }}SuperSave モードでは
Section titled “SuperSave モードでは”Unity を NANORA_MCP_SUPERSAVE=1 で起動したときは、メタツール execute から {"tool": "wait_for_selector", "args": { … }} の形で呼びます。SuperSave モードを参照。
Assets/NanoraUnityMCP/Editor/Tools/WaitForSelectorTool.cs(版 1.2.1)から生成しています。説明文はツール定義のまま(英語)です。AI クライアントは tools/list で同じスキーマを受け取ります。