Play Mode Testing
Control Play Mode, run EditMode/PlayMode tests, simulate input devices, and capture media. This skill is the runtime sibling of unity-input-system (asset authoring) and unity-ui-automation (UI interaction).
Use When
- The user wants to run EditMode or PlayMode tests.
- The task requires runtime input simulation.
- The user wants screenshots or video from the current game or editor state.
- The user wants to inspect current test progress or runtime state.
Do Not Use When
- The task is editing input action assets; use
unity-input-system. - The task targets only UI element interaction without runtime gameplay; use
unity-ui-automation. - The work is purely static scene or code inspection; use the corresponding read-only skill.
Preferred Flow
- Confirm editor state with
get_editor_statebefore entering Play Mode or running tests. - Enter Play Mode or start tests, then wait until the runtime is ready before sending input.
- Capture screenshots or short video only after the target state is visible.
- Stop Play Mode or recording cleanly and report the final status.
unity-cli raw play_game --json '{}'
unity-cli raw input_keyboard --json '{"key":"space","action":"press"}'
unity-cli raw capture_screenshot --json '{"captureMode":"game","width":1280,"height":720}'
unity-cli raw run_tests --json '{"testMode":"PlayMode"}'
unity-cli raw get_test_status --json '{}'
unity-cli raw stop_game --json '{}'
Examples
- "Run PlayMode tests for the player flow and report the result."
- "Enter Play Mode, press space, and capture a screenshot."
- "Record a 5 second gameplay clip and stop automatically."
References
- runtime-checklist.md: connection and instance prerequisites.
- playmode-test-loop.md: clean execution loop for entering Play Mode, sending input, waiting for results, and capturing evidence.