static void Run()
{
string serverroot = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf("Assets"));
KillRunningServer();
string model = "SimpleHTTPServer";
ProcessStartInfo startInfo = new ProcessStartInfo("python", string.Format("-m {0} {1}", model, port));
startInfo.WorkingDirectory = serverroot;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
Process launchProcess = Process.Start(startInfo);
if (launchProcess == null || launchProcess.HasExited == true || launchProcess.Id == 0)
{
Debugger.LogError("Unable Start AssetServer process");
}
else
{
instance.m_serverPID = launchProcess.Id;
Debugger.Log("Local AssetServer Listen: {0}, Root Dir: {1}", port, serverroot);
}
}