コード例 #1
0
        /// <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();
        }
コード例 #2
0
        public virtual void Update()
        {
            ThreadSafety.EnsureNotUpdateThread();

            Action action;

            while (PendingActions.TryDequeue(out action))
            {
                action();
            }
        }
コード例 #3
0
        /// <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();
            }
        }