uloop-control-play-mode

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

uloop control-play-mode

uloop control-play-mode

Control Unity Editor play mode (play/stop/pause).
控制Unity Editor播放模式(播放/停止/暂停)。

Usage

用法

bash
uloop control-play-mode [options]
bash
uloop control-play-mode [options]

Parameters

参数

ParameterTypeDefaultDescription
--action
string
Play
Action to perform:
Play
,
Stop
,
Pause
参数类型默认值描述
--action
字符串
Play
要执行的操作:
Play
Stop
Pause

Global Options

全局选项

OptionDescription
--project-path <path>
Target a specific Unity project (mutually exclusive with
--port
). Path resolution follows the same rules as
cd
— absolute paths are used as-is, relative paths are resolved from cwd.
-p, --port <port>
Specify Unity TCP port directly (mutually exclusive with
--project-path
).
选项描述
--project-path <path>
指定目标Unity项目(与
--port
互斥)。路径解析遵循与
cd
相同的规则——绝对路径直接使用,相对路径从当前工作目录解析。
-p, --port <port>
直接指定Unity TCP端口(与
--project-path
互斥)。

Examples

示例

bash
undefined
bash
undefined

Start play mode

启动播放模式

uloop control-play-mode --action Play
uloop control-play-mode --action Play

Stop play mode

停止播放模式

uloop control-play-mode --action Stop
uloop control-play-mode --action Stop

Pause play mode

暂停播放模式

uloop control-play-mode --action Pause
undefined
uloop control-play-mode --action Pause
undefined

Output

输出

Returns JSON with the current play mode state:
  • IsPlaying
    : Whether Unity is currently in play mode
  • IsPaused
    : Whether play mode is paused
  • Message
    : Description of the action performed
返回包含当前播放模式状态的JSON:
  • IsPlaying
    : Unity当前是否处于播放模式
  • IsPaused
    : 播放模式是否已暂停
  • Message
    : 已执行操作的描述信息

Notes

注意事项

  • Play action starts the game in the Unity Editor (also resumes from pause)
  • Stop action exits play mode and returns to edit mode
  • Pause action pauses the game while remaining in play mode
  • Useful for automated testing workflows
  • 播放操作会在Unity Editor中启动游戏(也可从暂停状态恢复)
  • 停止操作会退出播放模式并返回编辑模式
  • 暂停操作会暂停游戏但保持在播放模式中
  • 适用于自动化测试工作流