Enable or disable a GameObject (equivalent to the Inspector's top-left toggle). Use --no-active to disable. The default --active enables the object. Examples: u gameobject active -n HUD --no-active u gameobject active --id 12345 --active
(
ctx: typer.Context,
name: Annotated[str | None, typer.Option("--name", "-n", help="GameObject name")] = None,
id: Annotated[int | None, typer.Option("--id", help="Instance ID")] = None,
active: Annotated[
bool,
typer.Option("--active/--no-active", help="Set active (true) or inactive (false)"),
] = True,
)
| 167 | @gameobject_app.command("active") |
| 168 | @handle_cli_errors |
| 169 | def gameobject_active( |
| 170 | ctx: typer.Context, |
| 171 | name: Annotated[str | None, typer.Option("--name", "-n", help="GameObject name")] = None, |
| 172 | id: Annotated[int | None, typer.Option("--id", help="Instance ID")] = None, |
| 173 | active: Annotated[ |
| 174 | bool, |
| 175 | typer.Option("--active/--no-active", help="Set active (true) or inactive (false)"), |
| 176 | ] = True, |
| 177 | ) -> None: |
| 178 | """Enable or disable a GameObject (equivalent to the Inspector's top-left toggle). |
| 179 | |
| 180 | Use --no-active to disable. The default --active enables the object. |
| 181 | |
| 182 | Examples: |
| 183 | u gameobject active -n HUD --no-active |
| 184 | u gameobject active --id 12345 --active |
| 185 | """ |
| 186 | context: CLIContext = ctx.obj |
| 187 | |
| 188 | if not name and id is None: |
| 189 | _exit_usage("--name or --id required", "u gameobject active") |
| 190 | |
| 191 | result = context.client.gameobject.set_active( |
| 192 | active=active, |
| 193 | name=name, |
| 194 | instance_id=id, |
| 195 | ) |
| 196 | print_success(result.get("message", f"Active set to {active}")) |
| 197 | |
| 198 | |
| 199 | @gameobject_app.command("delete") |
nothing calls this directly
no test coverage detected