Skip to content

Add play.pause and play.step commands#39

Merged
Niaobu merged 3 commits intomainfrom
claude/add-play-mode-controls-gqb3A
Mar 23, 2026
Merged

Add play.pause and play.step commands#39
Niaobu merged 3 commits intomainfrom
claude/add-play-mode-controls-gqb3A

Conversation

@Niaobu
Copy link
Copy Markdown
Contributor

@Niaobu Niaobu commented Mar 22, 2026

Summary

  • Add play pause (toggle pause) and play step (advance one frame) CLI commands
  • play.pause works in both play and edit mode — in edit mode it arms "pause on play" so play mode starts paused on first frame
  • play.step returns a proper NOT_PLAYING error with exit code 1 when not in play mode
  • States are always one of playing, paused, stopped with an orthogonal pauseOnPlay boolean field when armed
  • play.status now distinguishes paused from playing, and reports pauseOnPlay when armed

Test plan

  • 8 integration tests covering pause/step in and out of play mode
  • 342 total tests pass
  • Verified live against Unity Editor: arm pause-on-play, enter play paused, step frames, unpause, re-pause, exit, error on step in edit mode

@Niaobu Niaobu self-assigned this Mar 22, 2026
claude and others added 3 commits March 23, 2026 11:01
Add pause toggle and single-frame step commands to the play mode command
group. Both are simple pass-through commands that return immediate results:

- play.pause: toggles EditorApplication.isPaused, returns "NotPlaying" if
  not in play mode
- play.step: calls EditorApplication.Step(), returns "NotPlaying" if not
  in play mode
- play.status: now reports "paused" state when isPaused is true

Includes integration tests for both commands in and out of play mode,
and updates the skill documentation.

https://claude.ai/code/session_01W1jn7vA3zkSigPaRHxh6a4
Unity allows setting EditorApplication.isPaused while in edit mode,
which causes play mode to start paused on the first frame. Remove the
isPlaying guard so play.pause works in both modes. Returns "pauseOnPlay"
state when armed in edit mode, "stopped" when disarmed.

https://claude.ai/code/session_01W1jn7vA3zkSigPaRHxh6a4
States now always report current state (playing/paused/stopped) rather
than action-specific values (stepped/NotPlaying/pauseOnPlay):

- play.pause: returns state + pauseOnPlay boolean when armed in edit mode
- play.step: returns "paused" on success, error NOT_PLAYING when not in
  play mode (exit code 1 with clear message)
- play.status: includes pauseOnPlay field when pause is armed

Removes PlayModeState.PauseOnPlay constant in favor of the boolean field
on PlayModeResult.
@Niaobu Niaobu force-pushed the claude/add-play-mode-controls-gqb3A branch from 2e08d32 to 78bd5c2 Compare March 23, 2026 10:02
@Niaobu Niaobu marked this pull request as ready for review March 23, 2026 10:02
@Niaobu Niaobu merged commit 48b1609 into main Mar 23, 2026
1 check passed
@Niaobu Niaobu deleted the claude/add-play-mode-controls-gqb3A branch March 23, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants