Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9cf564

Browse files
committed
handle unity 6000 different simplewebserver args,fixes#165
1 parent5954f47 commitf9cf564

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

‎UnityLauncherPro/Tools.cs‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,21 @@ public static void LaunchWebGL(Project proj, string relativeFolder)
20082008
// take process id from unity, if have it (then webserver closes automatically when unity is closed)
20092009
varproc=ProcessHandler.Get(proj.Path);
20102010
intpid=proc==null?-1:proc.Id;
2011-
varparam="\""+webExe+"\"\""+buildPath+"\" "+port+(pid==-1?"":" "+pid);// server exe path, build folder and port
2011+
stringparam=null;
2012+
2013+
// parse proj version year as number 2019.4.1f1 -> 2019
2014+
intyear=0;
2015+
varversionParts=proj.Version.Split('.');
2016+
boolparsedYear=int.TryParse(versionParts[0],outyear);
2017+
2018+
if(parsedYear&&year>=6000)
2019+
{
2020+
param="\""+webExe+"\"\""+buildPath+"\" "+"http://localhost:"+port+"/"+(pid==-1?"":" "+pid);
2021+
}
2022+
else// older versions or failed to parse
2023+
{
2024+
param="\""+webExe+"\"\""+buildPath+"\" "+port+(pid==-1?"":" "+pid);// server exe path, build folder and port
2025+
}
20122026

20132027
varwebglServerProcess=Tools.LaunchExe(monoExe,param);
20142028

@@ -2068,7 +2082,23 @@ public static void LaunchWebGL(Project proj, string relativeFolder)
20682082
// take process id from unity, if have it(then webserver closes automatically when unity is closed)
20692083
varproc=ProcessHandler.Get(proj.Path);
20702084
intpid=proc==null?-1:proc.Id;
2071-
varparam="\""+webExe+"\"\""+buildPath+"\" "+port+(pid==-1?"":" "+pid);// server exe path, build folder and port
2085+
2086+
// parse proj version year as number 2019.4.1f1 -> 2019
2087+
stringparam=null;
2088+
intyear=0;
2089+
varversionParts=proj.Version.Split('.');
2090+
boolparsedYear=int.TryParse(versionParts[0],outyear);
2091+
2092+
if(parsedYear&&year>=6000)
2093+
{
2094+
param="\""+webExe+"\"\""+buildPath+"\" "+"\"http://localhost:"+port+"/\""+(pid==-1?"":" "+pid);
2095+
}
2096+
else// older versions or failed to parse
2097+
{
2098+
param="\""+webExe+"\"\""+buildPath+"\" "+port+(pid==-1?"":" "+pid);// server exe path, build folder and port
2099+
}
2100+
2101+
//var param = "\"" + webExe + "\" \"" + buildPath + "\" " + port + (pid == -1 ? "" : " " + pid); // server exe path, build folder and port
20722102

20732103
varwebglServerProcess=Tools.LaunchExe(monoExe,param);
20742104

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp