본문으로 건너뛰기
cccskills
무료GitHub에 공개

uloop-simulate-mouse-ui

Simulate PlayMode EventSystem UI mouse actions using top-left Game View coordinates. Use for UI clicks, long-presses, or drags from annotated screenshots.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Task

Simulate mouse interaction on Unity PlayMode UI: $ARGUMENTS

Workflow

  1. Ensure Unity is in PlayMode (use npx --yes uloop-cli@2.2.0 control-play-mode --action Play if not)
  2. Get UI element info: npx --yes uloop-cli@2.2.0 screenshot --capture-mode rendering --annotate-elements true --elements-only true
  3. Use the AnnotatedElements array to find the target element by Label, Name, or Path (A=frontmost, B=next, ...). Use Interaction to distinguish click targets from drag/drop/text targets, then use SimX/SimY directly as --x/--y coordinates.
  4. Execute the appropriate npx --yes uloop-cli@2.2.0 simulate-mouse-ui command
  5. Take a screenshot to verify the result: npx --yes uloop-cli@2.2.0 screenshot --capture-mode rendering --annotate-elements true
  6. Report what happened

Tool Reference

npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action <action> --x <x> --y <y> [options]

Parameters

ParameterTypeDefaultDescription
--actionenumClickClick, Drag, DragStart, DragMove, DragEnd, LongPress
--xnumber0Target X position in Game View pixels (origin: top-left). Used by Click, LongPress, DragStart, DragMove, and DragEnd; for Drag, this is the destination.
--ynumber0Target Y position in Game View pixels (origin: top-left). Used by Click, LongPress, DragStart, DragMove, and DragEnd; for Drag, this is the destination.
--from-xnumber0Start X position in Game View pixels for Drag action. Drag starts here and moves to x,y.
--from-ynumber0Start Y position in Game View pixels for Drag action. Drag starts here and moves to x,y.
--drag-speednumber2000Drag speed in pixels per second (0 for instant). 2000 is fast (default), 200 is slow enough to watch. Applies to Drag, DragMove, and DragEnd actions.
--durationnumber0.5Hold duration in seconds for LongPress action.
--buttonenumLeftMouse button. Click and LongPress support Left, Right, and Middle. Drag actions support Left only; other buttons return an error.
--bypass-raycastbooleanfalseFor Click, LongPress, Drag, and DragStart, bypass EventSystem raycast and dispatch pointer events directly to --target-path. Use when a raycast-blocking overlay visually covers the intended target.
--target-pathstring""Hierarchy path of the target GameObject, for example Canvas/Panel/Button. Required when --bypass-raycast true is used with Click, LongPress, Drag, or DragStart; prefer AnnotatedElements[].Path from screenshot JSON.
--drop-target-pathstring""Optional hierarchy path of a drop target for Drag or DragEnd, for example Canvas/DropZone. Use this when the drop zone is also behind a raycast blocker.

Actions

ActionEvent FiredDescription
ClickPointerDown → PointerUp → PointerClickClick at (x, y) with the selected --button
LongPressPointerDown → (hold) → PointerUpPress and hold at (x, y) for --duration seconds, then release. No PointerClick is fired.
DragBeginDrag → Drag×N → EndDragOne-shot drag from (fromX, fromY) to (x, y) at the specified speed
DragStartBeginDragBegin drag at (x, y) and hold
DragMoveDrag×NAnimate from current position to (x, y) at the specified speed
DragEndDrag×N → EndDragAnimate to (x, y) at the specified speed, then release drag

Split Drag Rules

  • DragStart must be called before DragMove or DragEnd
  • DragEnd must be called to release an active drag — failing to call it leaves drag state stuck
  • Calling DragMove or DragEnd without an active drag returns an error
  • Drag, DragStart, DragMove, and DragEnd only support --button Left

Global Options (all optional, mutually exclusive)

OptionDescription
--project-path <path>Optional. Use only when the target Unity project is not the current directory.

Coordinate System

  • Origin is top-left (0, 0)
  • All positions are in top-left Game View pixels
  • Get coordinates from AnnotatedElements JSON (SimX/SimY) — do NOT look up GameObject positions
  • Clicking or long-pressing on empty space (no UI element) still succeeds with a message indicating no element was hit
  • Dragging on empty space (no draggable UI element) returns Success = false
  • --bypass-raycast true still uses coordinates for pointer event positions, but chooses the clicked, long-pressed, or dragged GameObject by --target-path
  • If --target-path or --drop-target-path matches multiple active GameObjects, the command fails instead of choosing an arbitrary duplicate

Examples

# Click a button at a Game View position
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Click --x 400 --y 300

# Force-click a button behind a raycast blocker by path
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Click --x 400 --y 300 --bypass-raycast true --target-path "Canvas/Panel/Button"

# Force-long-press a button behind a raycast blocker by path
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action LongPress --x 400 --y 300 --duration 3.0 --bypass-raycast true --target-path "Canvas/Panel/Button"

# Force-drag an item behind a raycast blocker by path
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Drag --from-x 400 --from-y 300 --x 600 --y 300 --bypass-raycast true --target-path "Canvas/Item"

# Force-drag and dispatch Drop to a blocked drop zone
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Drag --from-x 400 --from-y 300 --x 600 --y 300 --bypass-raycast true --target-path "Canvas/Item" --drop-target-path "Canvas/DropZone"

# Long-press a button for 3 seconds
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action LongPress --x 400 --y 300 --duration 3.0

# One-shot drag (start to end in one call)
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Drag --from-x 400 --from-y 300 --x 600 --y 300

# Slow drag for visual inspection
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action Drag --from-x 400 --from-y 300 --x 600 --y 300 --drag-speed 200

# Split drag with hold (for inspection between steps)
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action DragStart --x 400 --y 300
npx --yes uloop-cli@2.2.0 screenshot --window-name Game
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action DragMove --x 500 --y 300
npx --yes uloop-cli@2.2.0 simulate-mouse-ui --action DragEnd --x 600 --y 300

Prerequisites

  • Unity must be in PlayMode
  • Target scene must have an EventSystem GameObject
  • UI elements must have a GraphicRaycaster on their Canvas
  • If you need gameplay mouse input rather than UI pointer events, simulate-mouse-input assumes the project uses the New Input System; otherwise prefer execute-dynamic-code

Output

Returns JSON with:

  • Success: Whether the operation succeeded
  • Message: Status message (e.g. "Hit element: ButtonStart" or "No UI element under (x, y)")
  • Action: Echoes which action was executed (Click, Drag, DragStart, DragMove, DragEnd, or LongPress)
  • HitGameObjectName: Name of the topmost UI element under the pointer (nullable string; null if nothing was hit)
  • PositionX: Target X coordinate that was used
  • PositionY: Target Y coordinate that was used
  • EndPositionX: Drag end X coordinate (nullable float; populated for drag actions only)
  • EndPositionY: Drag end Y coordinate (nullable float; populated for drag actions only)

These are the only eight fields. There is no Button, Duration, DragSpeed, raycast list, or pointer-event log in the response — verify the visual outcome with a follow-up npx --yes uloop-cli@2.2.0 screenshot --capture-mode rendering --annotate-elements true.

Note: Click and LongPress on empty space (no UI element) still return Success = true with HitGameObjectName = null. Drag actions on empty space return Success = false.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

41h0-siro/cedec2026-lt-ai-ui-workflow42026년 7월 23일 업데이트

41h0-siro의 스킬 모두 보기

이 스킬의 문제 신고