public static void Open(ShellExecutor executor) { if (_instance != null) { _instance.Close(); } _executor = executor; var win = ShellExecutorEditWindow.CreateInstance <ShellExecutorEditWindow>(); win.titleContent = new GUIContent("Editor"); win.ShowUtility(); _instance = win; }
private void OnGUI() { EditorGUILayout.LabelField("Executors:"); foreach (var executor in _executors) { GUILayout.BeginHorizontal(EditorStyles.helpBox); GUIHelper.Status(executor.status); EditorGUILayout.LabelField(executor.displayName); if (GUILayout.Button("Edit")) { ShellExecutorEditWindow.Open(executor); } EditorGUI.BeginDisabledGroup(executor.status == ShellExecutor.Status.Running); if (GUILayout.Button("Execute")) { executor.Execute().onExit += (exitCode) => { this.Repaint(); }; } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); } }