/// <summary> /// Updates this audio component. Always runs on the audio thread. /// </summary> public void Update() { ThreadSafety.EnsureNotUpdateThread(); if (IsDisposed) { throw new ObjectDisposedException(ToString(), "Can not update disposed audio components."); } FrameStatistics.Add(StatisticsCounterType.TasksRun, PendingActions.Count); FrameStatistics.Increment(StatisticsCounterType.Components); Task task; while (!IsDisposed && PendingActions.TryDequeue(out task)) { task.RunSynchronously(); } if (!IsDisposed) { UpdateState(); } UpdateChildren(); }
public virtual void Update() { ThreadSafety.EnsureNotUpdateThread(); Action action; while (PendingActions.TryDequeue(out action)) { action(); } }
/// <summary> /// Updates this audio component. Always runs on the audio thread. /// </summary> public virtual void Update() { ThreadSafety.EnsureNotUpdateThread(); if (IsDisposed) { throw new ObjectDisposedException(ToString(), "Can not update disposed audio components."); } FrameStatistics.Increment(StatisticsCounterType.TasksRun, PendingActions.Count); FrameStatistics.Increment(StatisticsCounterType.Components); Action action; while (!IsDisposed && PendingActions.TryDequeue(out action)) { action(); } }