Skip to content

Commit 3657168

Browse files
authored
Merge pull request #10 from NoTaskStudios/fix/hub-integration
fix(Editor): Force hubIPC and usehub to add projects
2 parents fca3539 + 548c8e9 commit 3657168

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/unityEditor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ class UnityEditor {
562562
* @public
563563
* @static
564564
* @param {ProjectInfo} projectInfo - Information about the project to open
565+
* @param {boolean} [useHub=true] - Whether to use Unity Hub for launching the project
565566
* @param {boolean} [batchmode=false] - Whether to run Unity in batch mode (headless, no UI)
566567
* Use true for CI/CD pipelines or server environments
567568
* @param {boolean} [waitForExit=true] - Whether to wait for Unity to exit before resolving the promise
@@ -584,6 +585,7 @@ class UnityEditor {
584585
*/
585586
public static async openProject(
586587
projectInfo: ProjectInfo,
588+
useHub: boolean = true,
587589
batchmode: boolean = false,
588590
waitForExit: boolean = true
589591
): Promise<boolean> {
@@ -600,6 +602,10 @@ class UnityEditor {
600602
args.push("-batchmode");
601603
}
602604

605+
if (useHub) {
606+
args.push(...["-useHub", "-hubIPC"]);
607+
}
608+
603609
const editorInfo = { version: projectInfo.editorVersion };
604610
const options = { reject: false };
605611

0 commit comments

Comments
 (0)