File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments