Skip to content

Commit 3ae9d10

Browse files
committed
fix launching empty folder from context menu, without preferred unity version
1 parent 6f7ccf7 commit 3ae9d10

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

UnityLauncherPro/MainWindow.xaml.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void HandleCommandLineLaunch()
184184
var commandLineArgs = args[1];
185185
if (commandLineArgs == "-projectPath")
186186
{
187-
Console.WriteLine("Launching from commandline ...");
187+
Console.WriteLine("Launching from commandline...");
188188

189189
// path
190190
var projectPathArgument = args[2];
@@ -1801,9 +1801,10 @@ void CreateNewEmptyProject(string targetFolder = null)
18011801

18021802
if (string.IsNullOrEmpty(newVersion))
18031803
{
1804-
Console.WriteLine("Missing selected Unity version");
1805-
SetStatus("Missing selected Unity version (it's null, this should not happen)");
1806-
return;
1804+
Console.WriteLine("Missing selected Unity version, probably launching from context menu");
1805+
newVersion = preferredVersion;
1806+
// if no preferred version, use latest
1807+
if (preferredVersion == null) newVersion = unityInstallationsSource[0].Version;
18071808
}
18081809

18091810
var suggestedName = targetFolder != null ? Path.GetFileName(targetFolder) : Tools.GetSuggestedProjectName(newVersion, rootFolder);

0 commit comments

Comments
 (0)