|
|
|
|
|
|
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() { |
|
|
|