Launch Unity Editor by version. Convenience function that looks up the editor path by version. Args: version: Unity version string (e.g., "2022.3.10f1"). project_path: Path to Unity project. wait: If True, wait for editor to close. Returns: Popen object
(
version: str,
project_path: Path,
wait: bool = False,
)
| 39 | |
| 40 | |
| 41 | def launch_editor_with_version( |
| 42 | version: str, |
| 43 | project_path: Path, |
| 44 | wait: bool = False, |
| 45 | ) -> subprocess.Popen[bytes] | None: |
| 46 | """Launch Unity Editor by version. |
| 47 | |
| 48 | Convenience function that looks up the editor path by version. |
| 49 | |
| 50 | Args: |
| 51 | version: Unity version string (e.g., "2022.3.10f1"). |
| 52 | project_path: Path to Unity project. |
| 53 | wait: If True, wait for editor to close. |
| 54 | |
| 55 | Returns: |
| 56 | Popen object if not waiting, None if waiting. |
| 57 | |
| 58 | Raises: |
| 59 | EditorNotFoundError: If editor version not installed. |
| 60 | """ |
| 61 | from unity_cli.exceptions import EditorNotFoundError |
| 62 | from unity_cli.hub.paths import find_editor_by_version |
| 63 | |
| 64 | editor = find_editor_by_version(version) |
| 65 | if editor is None: |
| 66 | raise EditorNotFoundError( |
| 67 | f"Unity {version} is not installed", |
| 68 | code="EDITOR_NOT_FOUND", |
| 69 | ) |
| 70 | |
| 71 | return launch_editor(editor.path, project_path, wait) |
nothing calls this directly
no test coverage detected