public void IssueEditorUpdate() { if (EditorUpdate != null) { EditorUpdate.Invoke(); } }
public static Task <bool> updateText(string editorText) { _editorText = editorText; EditorUpdate?.Invoke(null, editorText); return(Task.FromResult(true)); }
private void MasterTimeTick(object sender, EventArgs e) { EditorUpdate?.Invoke(this, e); }
internal static void EditorRootUpdate() { EditorUpdate?.Invoke(); }
private void ProcessForegroundQueue() { EditorUpdate?.Invoke(this, EventArgs.Empty); _foregroundStepStopwatch.Restart(); for (; _foregroundStepStopwatch.Elapsed.TotalMilliseconds < 16;) { if (_enumeration != null) { try { if (!_enumeration.MoveNext()) { _enumeration.Dispose(); _enumeration = null; } else { CurrentReport = _enumeration.Current; } } catch (Exception exception) { CurrentReport = exception.ToString(); Debug.LogError(exception); _enumeration?.Dispose(); _enumeration = null; } } else { Func <IEnumerable <ProgressBarReport> > task; lock (_gate) { if (_foregroundTasks.Count == 0) { CurrentReport = ""; _completeForegroundTasksCounter = 0; EditorApplication.update = Delegate.Remove(EditorApplication.update, _processForegroundQueue) as EditorApplication.CallbackFunction; return; } ++_completeForegroundTasksCounter; task = _foregroundTasks.Dequeue(); } try { _enumeration = task().GetEnumerator(); } catch (Exception exception) { CurrentReport = exception.ToString(); Debug.LogError(exception); } } } }