@@ -53,14 +53,24 @@ private void Form1_Load(object sender, EventArgs e)
53
53
return ;
54
54
}
55
55
56
- // check if received any arguments (that means, should try open the project)
56
+ // test: -projectPath "D:\download\Swarm-master(1)\Swarm-master"
57
+
58
+ // check if received -projectPath argument (that means, should try open the project)
57
59
string [ ] args = Environment . GetCommandLineArgs ( ) ;
58
- if ( args != null && args . Length > 1 )
60
+ if ( args != null && args . Length > 2 )
59
61
{
60
- var pathArg = args [ 1 ] ;
61
- Console . WriteLine ( "\n PATH: " + pathArg ) ;
62
- Console . WriteLine ( "" ) ;
63
- LaunchProject ( pathArg ) ;
62
+ var commandArg = args [ 1 ] ;
63
+ if ( commandArg == "-projectPath" )
64
+ {
65
+ var pathArg = args [ 2 ] ;
66
+ Console . WriteLine ( "\n PATH: " + pathArg ) ;
67
+ LaunchProject ( pathArg ) ;
68
+ }
69
+ else
70
+ {
71
+ Console . WriteLine ( "Invalid arguments:" + args [ 1 ] ) ;
72
+ }
73
+
64
74
}
65
75
66
76
// this could be delayed, if it affects unity starting?
@@ -153,7 +163,7 @@ bool ScanUnityInstallations()
153
163
if ( File . Exists ( uninstallExe ) == true )
154
164
{
155
165
var unityVersion = GetUnityVersion ( uninstallExe ) . Replace ( "Unity" , "" ) . Trim ( ) ;
156
- if ( unityList . ContainsKey ( unityVersion ) == false )
166
+ if ( unityList . ContainsKey ( unityVersion ) == false )
157
167
{
158
168
unityList . Add ( unityVersion , unityExe ) ;
159
169
}
@@ -211,7 +221,7 @@ void UpdateRecentProjectsList()
211
221
string csprojFile = Path . Combine ( projectPath , projectName + ".csproj" ) ;
212
222
213
223
// editor only project
214
- if ( File . Exists ( csprojFile ) == false )
224
+ if ( File . Exists ( csprojFile ) == false )
215
225
{
216
226
csprojFile = Path . Combine ( projectPath , projectName + ".Editor.csproj" ) ;
217
227
}
@@ -223,7 +233,7 @@ void UpdateRecentProjectsList()
223
233
224
234
gridRecent . Rows . Add ( projectName , projectVersion , projectPath , lastUpdated ) ;
225
235
//gridRecent.Rows[gridRecent.Rows.Count-1].Cells[1].Style.BackColor = HaveExactVersionInstalled(projectVersion) ?Color.Green:Color.Red;
226
- gridRecent . Rows [ gridRecent . Rows . Count - 1 ] . Cells [ 1 ] . Style . ForeColor = HaveExactVersionInstalled ( projectVersion ) ? Color . Green : Color . Red ;
236
+ gridRecent . Rows [ gridRecent . Rows . Count - 1 ] . Cells [ 1 ] . Style . ForeColor = HaveExactVersionInstalled ( projectVersion ) ? Color . Green : Color . Red ;
227
237
}
228
238
}
229
239
}
@@ -420,7 +430,7 @@ private void btn_openFolder_Click(object sender, EventArgs e)
420
430
421
431
void LaunchExplorer ( string folder )
422
432
{
423
- if ( Directory . Exists ( folder ) == true )
433
+ if ( Directory . Exists ( folder ) == true )
424
434
{
425
435
Process . Start ( folder ) ;
426
436
}
0 commit comments