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

Method click

unity_cli/api/uitree.py:111–141  ·  view source on GitHub ↗

Click a UI element. Args: ref: Element reference ID (e.g., "ref_3"). panel: Panel name (used with name). name: Element name (used with panel). button: Mouse button (0=left, 1=right, 2=middle). click_count: Click count (2=double cli

(
        self,
        ref: str | None = None,
        panel: str | None = None,
        name: str | None = None,
        button: int = 0,
        click_count: int = 1,
    )

Source from the content-addressed store, hash-verified

109 return self._conn.send_request("uitree", params)
110
111 def click(
112 self,
113 ref: str | None = None,
114 panel: str | None = None,
115 name: str | None = None,
116 button: int = 0,
117 click_count: int = 1,
118 ) -> dict[str, Any]:
119 """Click a UI element.
120
121 Args:
122 ref: Element reference ID (e.g., "ref_3").
123 panel: Panel name (used with name).
124 name: Element name (used with panel).
125 button: Mouse button (0=left, 1=right, 2=middle).
126 click_count: Click count (2=double click).
127
128 Returns:
129 Dictionary containing click result.
130 """
131 params: dict[str, Any] = {"action": "click"}
132 if ref:
133 params["ref"] = ref
134 self._add_panel_param(params, panel)
135 if name:
136 params["name"] = name
137 if button != 0:
138 params["button"] = button
139 if click_count != 1:
140 params["click_count"] = click_count
141 return self._conn.send_request("uitree", params)
142
143 def scroll(
144 self,

Calls 2

_add_panel_paramMethod · 0.95
send_requestMethod · 0.80