MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / text

Method text

unity_cli/api/uitree.py:179–201  ·  view source on GitHub ↗

Get text content of a UI element. Args: ref: Element reference ID (e.g., "ref_7"). panel: Panel name (used with name). name: Element name (used with panel). Returns: Dictionary containing element text.

(
        self,
        ref: str | None = None,
        panel: str | None = None,
        name: str | None = None,
    )

Source from the content-addressed store, hash-verified

177 return self._conn.send_request("uitree", params)
178
179 def text(
180 self,
181 ref: str | None = None,
182 panel: str | None = None,
183 name: str | None = None,
184 ) -> dict[str, Any]:
185 """Get text content of a UI element.
186
187 Args:
188 ref: Element reference ID (e.g., "ref_7").
189 panel: Panel name (used with name).
190 name: Element name (used with panel).
191
192 Returns:
193 Dictionary containing element text.
194 """
195 params: dict[str, Any] = {"action": "text"}
196 if ref:
197 params["ref"] = ref
198 self._add_panel_param(params, panel)
199 if name:
200 params["name"] = name
201 return self._conn.send_request("uitree", params)

Calls 2

_add_panel_paramMethod · 0.95
send_requestMethod · 0.80