Home > OS >  How to create a unity project using a custom piece of code
How to create a unity project using a custom piece of code

Time:05-17

What I want to do is basically press a button in my application(C# WPF) and create a unity project in a predefined version, import some packages and then launch it.

I have no Idea if that's possible or not. I haven't found anything yet.

Would be awesome if you got a way to do it! Thanks in advance :)

CodePudding user response:

You can use the Unity command line to create a project and import a package in c# like this:

using System.Diagnostics;

...

var arguments = $" -createProject {path} -importPackage {packagePath}";
var process = Process.Start(@"C:\Program Files\Unity\Editor\Unity.exe", arguments);

Check this page https://docs.unity3d.com/Manual/EditorCommandLineArguments.html

  • Related