static void Command(TargetPlatform targetPlatform, string dataPath) { string toolDataPath = dataPath + "/Oculus/VR/Editor/Tools"; if (!Directory.Exists(toolDataPath)) { Directory.CreateDirectory(toolDataPath); } string platformUtil = toolDataPath + "/ovr-platform-util.exe"; if (!System.IO.File.Exists(platformUtil)) { OVRPlugin.SendEvent("oculus_platform_tool", "provision_util"); EditorCoroutine downloadCoroutine = EditorCoroutine.Start(ProvisionPlatformUtil(platformUtil)); while (!downloadCoroutine.GetCompleted()) { } } string args = genUploadCommand(targetPlatform); var process = new Process(); var processInfo = new ProcessStartInfo(platformUtil, args); processInfo.CreateNoWindow = true; processInfo.UseShellExecute = false; processInfo.RedirectStandardError = true; processInfo.RedirectStandardOutput = true; process.StartInfo = processInfo; process.OutputDataReceived += new DataReceivedEventHandler( (s, e) => { if (e.Data.Length != 0 && !e.Data.Contains("\u001b")) { OVRPlatformTool.log += e.Data + "\n"; } } ); process.ErrorDataReceived += new DataReceivedEventHandler( (s, e) => { OVRPlatformTool.log += e.Data + "\n"; } ); process.Start(); process.BeginOutputReadLine(); process.BeginErrorReadLine(); }
private static string CheckForPlatformUtil(string dataPath) { string toolDataPath = dataPath + "/Oculus/VR/Editor/Tools"; if (!Directory.Exists(toolDataPath)) { Directory.CreateDirectory(toolDataPath); } string platformUtil = toolDataPath + "/ovr-platform-util.exe"; if (!System.IO.File.Exists(platformUtil)) { OVRPlugin.SendEvent("oculus_platform_tool", "provision_util"); EditorCoroutine downloadCoroutine = EditorCoroutine.Start(ProvisionPlatformUtil(platformUtil)); while (!downloadCoroutine.GetCompleted()) { } } return(platformUtil); }