|
|
|
|
|
|
|
|
|
|
var (pythonPid, port, visualizerPid) = ReadEntry(project); |
|
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Checking if instance exists", 0.5f / 4); |
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Opening", 4f / 4); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
} |
|
|
|
//Otherwise delete any previous entry for this project and launch a new process
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Running executable", 1f / 4); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Finding Visualizer instance", 2f / 4); |
|
|
|
var newVisualizerPid = -1; |
|
|
|
var attempts = 0; |
|
|
|
while(newVisualizerPid == -1) |
|
|
|
|
|
|
if(attempts == maxAttempts) |
|
|
|
{ |
|
|
|
Debug.LogError("Failed to get visualizer ID"); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
return; |
|
|
|
} |
|
|
|
attempts++; |
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Finding Streamlit instance", 3f / 4); |
|
|
|
var newPythonPid = -1; |
|
|
|
attempts = 0; |
|
|
|
while(newPythonPid == -1) |
|
|
|
|
|
|
if(attempts == maxAttempts) |
|
|
|
{ |
|
|
|
Debug.LogError("Failed to get python ID"); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
return; |
|
|
|
} |
|
|
|
attempts++; |
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Finding Port", 3.5f / 4); |
|
|
|
var newPort = -1; |
|
|
|
attempts = 0; |
|
|
|
while(newPort == -1) |
|
|
|
|
|
|
if(attempts == maxAttempts) |
|
|
|
{ |
|
|
|
Debug.LogError("Failed to get PORT"); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
return; |
|
|
|
} |
|
|
|
attempts++; |
|
|
|
|
|
|
LaunchBrowser(newPort); |
|
|
|
}*/ |
|
|
|
|
|
|
|
EditorUtility.DisplayProgressBar("Opening Visualizer", "Opening", 4f / 4); |
|
|
|
EditorUtility.ClearProgressBar(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|