/// <summary> /// Show progress bar with zero progress. /// </summary> /// <param name="title">Title of progress bar</param> /// <param name="OnCancel">Invoked if user canceled operation</param> public static void Show(string title, Action OnCancel = null) { _title = title; _progress = 0f; _onCancel = OnCancel; Update(_FIRST_STATUS); if (_closed) { _closed = false; MainThreadCallback.Push(UpdateProgress()); } }
private void HandleExitedAsync() { bool success = false; try { HandleExited(_outputAsync.ToString(), _errorsAsync.ToString()); success = !_isAborted; } catch (Exception e) { UnityEngine.Debug.LogError(e); } finally { if (_onExited != null) { MainThreadCallback.Push(() => _onExited(success)); } } }
/// <summary> /// Close progress bar /// </summary> public static void Close() { _closed = true; MainThreadCallback.Push(EditorUtility.ClearProgressBar); }