Destroy a GameObject from the active scene. Examples: u gameobject delete -n TempSpawn u gameobject delete --id 12345
(
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,
)
| 199 | @gameobject_app.command("delete") |
| 200 | @handle_cli_errors |
| 201 | def gameobject_delete( |
| 202 | ctx: typer.Context, |
| 203 | name: Annotated[str | None, typer.Option("--name", "-n", help="GameObject name")] = None, |
| 204 | id: Annotated[int | None, typer.Option("--id", help="Instance ID")] = None, |
| 205 | ) -> None: |
| 206 | """Destroy a GameObject from the active scene. |
| 207 | |
| 208 | Examples: |
| 209 | u gameobject delete -n TempSpawn |
| 210 | u gameobject delete --id 12345 |
| 211 | """ |
| 212 | context: CLIContext = ctx.obj |
| 213 | |
| 214 | if not name and id is None: |
| 215 | _exit_usage("--name or --id required", "u gameobject delete") |
| 216 | |
| 217 | result = context.client.gameobject.delete(name=name, instance_id=id) |
| 218 | print_success(result.get("message", "GameObject deleted")) |
nothing calls this directly
no test coverage detected