@@ -13,6 +13,7 @@ public partial class NewProject : Window
1313 public static string newName = null ;
1414 public static string templateZipPath = null ;
1515 public static string selectedPlatform = null ;
16+ public static string [ ] platformsForThisUnity = null ;
1617
1718 bool isInitializing = true ; // to keep OnChangeEvent from firing too early
1819 int previousSelectedTemplateIndex = - 1 ;
@@ -77,17 +78,17 @@ void UpdateTemplatesDropDown(string unityPath)
7778
7879 void UpdateModulesDropdown ( string version )
7980 {
80- // get modules and stick into combobox
81- var platformsForThisUnity = Tools . GetPlatformsForUnityVersion ( version ) ;
81+ // get modules and stick into combobox, NOTE we already have this info from GetProjects.Scan, so could access it
82+ platformsForThisUnity = Tools . GetPlatformsForUnityVersion ( version ) ;
8283 cmbNewProjectPlatform . ItemsSource = platformsForThisUnity ;
8384 //System.Console.WriteLine(Tools.GetPlatformsForUnityVersion(version).Length);
8485
8586 var lastUsedPlatform = Properties . Settings . Default . newProjectPlatform ;
8687
8788 for ( int i = 0 ; i < platformsForThisUnity . Length ; i ++ )
8889 {
89- // set default platform (now win64) if never used this before
90- if ( platformsForThisUnity [ i ] . ToLower ( ) == "win64" || platformsForThisUnity [ i ] == lastUsedPlatform )
90+ // set default platform (win64) if never used this setting before
91+ if ( ( lastUsedPlatform == null && platformsForThisUnity [ i ] . ToLower ( ) == "win64" ) || platformsForThisUnity [ i ] == lastUsedPlatform )
9192 {
9293 cmbNewProjectPlatform . SelectedIndex = i ;
9394 break ;
@@ -143,9 +144,8 @@ private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
143144 cmbNewProjectTemplate . SelectedIndex = ++ cmbNewProjectTemplate . SelectedIndex % cmbNewProjectTemplate . Items . Count ;
144145 e . Handled = true ; // override writing to textbox
145146 break ;
146- case Key . Enter : // enter accept
147- UpdateSelectedVersion ( ) ;
148- DialogResult = true ;
147+ case Key . Enter : // enter, create proj
148+ BtnCreateNewProject_Click ( null , null ) ;
149149 e . Handled = true ;
150150 break ;
151151 case Key . Escape : // esc cancel
0 commit comments