浏览代码

hide command prompt and use a progress bar instead

/pyrception-integration
leopoldo-zugasti 4 年前
当前提交
be5c79ed
共有 1 个文件被更改,包括 21 次插入3 次删除
  1. 24
      com.unity.perception/Editor/Pyrception/PyrceptionInstaller.cs

24
com.unity.perception/Editor/Pyrception/PyrceptionInstaller.cs


using System.Diagnostics;
using System.Threading;
public class PyrceptionInstaller
{
public class PyrceptionInstaller : EditorWindow
{
string path = Application.dataPath.Replace("/Assets","").Replace("/","\\");
string command = $"cd {path}\\DataInsightsEnv\\Scripts\\ && activate && pyrception-utils.exe preview --data=\"{PlayerPrefs.GetString(SimulationState.latestOutputDirectoryKey)}/..\"";

[MenuItem("Window/General/Pyrception/Setup")]
static void SetupPyrception()
{
int steps = 4;
EditorUtility.DisplayProgressBar("Setting up Pyrception", "Installing virtualenv...", 0 / steps);
EditorUtility.DisplayProgressBar("Setting up Pyrception", "Setting up virtualenv instance...", 1f / steps);
EditorUtility.DisplayProgressBar("Setting up Pyrception", "Getting pyrception files...", 2f / steps);
EditorUtility.DisplayProgressBar("Setting up Pyrception", "Installing pyrception utils...", 3.5f / steps);
EditorUtility.DisplayProgressBar("Setting up Pyrception", "Installing pyrception utils...", 3.9f / steps);
EditorUtility.ClearProgressBar();
}
private static int ExecuteCMD(string command) {

{
UnityEngine.Debug.LogError($"Error - {ExitCode} - Failed to execute: {command}");
}
else
{
//UnityEngine.Debug.Log($"Successfully executed: {command}");
}
return cmd.ExitCode;
cmd.Close();
return ExitCode;
}
private static void RevertChanges() {

正在加载...
取消
保存