Skip to content

Commit eb86bd3

Browse files
committed
create project: if selected editor version is not installed, pick next available version
1 parent ed8c3e5 commit eb86bd3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System.Drawing; // for notifyicon
1212
using System.IO;
1313
using System.IO.Pipes;
14+
using System.Linq;
1415
using System.Runtime.InteropServices;
1516
using System.Text.RegularExpressions;
1617
using System.Threading;
@@ -2147,6 +2148,12 @@ void CreateNewEmptyProject(string targetFolder = null)
21472148
initScriptFileFullPath = Tools.GetSafeFilePath("Scripts", "InitializeProject.cs");
21482149
}
21492150

2151+
// if newversion is not installed, pick next available version
2152+
if (MainWindow.unityInstalledVersions.ContainsKey(newVersion) == false)
2153+
{
2154+
newVersion = Tools.FindNearestVersion(newVersion, MainWindow.unityInstalledVersions.Keys.ToList());
2155+
}
2156+
21502157
// for new projects created from explorer, always ask for name
21512158
if (chkAskNameForQuickProject.IsChecked == true || targetFolder != null)
21522159
{

0 commit comments

Comments
 (0)