Example #1
0
        private void UpdateReallyLoopRendering()
        {
            var newValue = !IsInDesignMode &&
                           IsLoopRendering &&
                           Renderer != null &&
                           surface != null &&
                           VisualParent != null &&
                           IsVisible;

            newValue = false;

            if (newValue != isReallyLoopRendering)
            {
                isReallyLoopRendering = newValue;
                if (isReallyLoopRendering)
                {
                    renderTimer.Resume();
                    renderTimer.Tick();
                    lastFpsUpdate                = renderTimer.TotalTime;
                    fpsFrameCounter              = 0;
                    CompositionTarget.Rendering += OnLoopRendering;
                }
                else
                {
                    CompositionTarget.Rendering -= OnLoopRendering;
                    renderTimer.Pause();
                }
            }
        }
Example #2
0
        public void Pause(bool pause)
        {
            m_Pause = pause;

            if (m_Pause)
            {
                m_Timer.Pause();
            }
            else
            {
                m_Timer.Resume();
            }
        }
Example #3
0
        public override void Pause(bool pause)
        {
            base.Pause(pause);
            m_Shot.Pause(m_Pause);

            if (m_Pause)
            {
                m_ShotTimer.Pause();
                m_VectorTimer.Pause();
            }
            else
            {
                m_ShotTimer.Resume();
                m_VectorTimer.Resume();
            }
        }