|
|
|
|
|
|
[MenuItem("Window/Pyrception/Run")] |
|
|
|
static void RunPyrception() |
|
|
|
{ |
|
|
|
if (currentProcessId != -1) |
|
|
|
{ |
|
|
|
UnityEngine.Debug.Log($"Process is alive - {currentProcessId}"); |
|
|
|
|
|
|
|
Process proc = Process.GetProcessById(currentProcessId+1); |
|
|
|
if(proc == null) |
|
|
|
{ |
|
|
|
UnityEngine.Debug.Log("Could not find process"); |
|
|
|
} |
|
|
|
proc.Kill(); |
|
|
|
currentProcessId = -1; |
|
|
|
} |
|
|
|
KillProcess(); |
|
|
|
|
|
|
|
string path = Path.GetFullPath(Application.dataPath.Replace("/Assets", "")); |
|
|
|
#if UNITY_EDITOR_WIN
|
|
|
|
|
|
|
#endif
|
|
|
|
if (ExitCode != 0) { |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
} |
|
|
|
|
|
|
|
void OnDestroy() |
|
|
|
{ |
|
|
|
KillProcess(); |
|
|
|
} |
|
|
|
|
|
|
|
private static void KillProcess() |
|
|
|
{ |
|
|
|
if (currentProcessId != -1) |
|
|
|
{ |
|
|
|
UnityEngine.Debug.Log($"Process is alive - {currentProcessId}"); |
|
|
|
|
|
|
|
Process proc = Process.GetProcessById(currentProcessId + 1); |
|
|
|
if (proc == null) |
|
|
|
{ |
|
|
|
UnityEngine.Debug.Log("Could not find process"); |
|
|
|
} |
|
|
|
proc.Kill(); |
|
|
|
currentProcessId = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|