Skip to content

Commit 4b0adad

Browse files
committed
refactor(Editor): Improve editor functions api for projects
1 parent fca3256 commit 4b0adad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/unityEditor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,16 +529,21 @@ class UnityEditor {
529529
* console.error("Project creation failed");
530530
* }
531531
*/
532-
public static async createProject(projectInfo: ProjectInfo, waitForExit: boolean = true): Promise<boolean> {
532+
public static async createProject(
533+
projectInfo: ProjectInfo,
534+
quit: boolean = false,
535+
useHub: boolean = true
536+
): Promise<boolean> {
533537
try {
534538
console.debug(`Creating new project at ${projectInfo.projectPath}`);
535539

536540
const parentDir = path.dirname(projectInfo.projectPath);
537541
await fs.ensureDir(parentDir);
538542

539543
const args = ["-createProject", projectInfo.projectPath];
544+
if (useHub) args.push("-useHub", "-hubIPC");
540545

541-
if (waitForExit) args.push("-quit");
546+
if (quit) args.push("-quit");
542547

543548
const editorInfo = { version: projectInfo.editorVersion };
544549
const { stdout, stderr } = await this.execUnityEditorCommand(editorInfo, args, {

0 commit comments

Comments
 (0)