示例#1
0
        void Update()
        {
            if (m_Store == null)
            {
                return;
            }

            m_Store.GetState().EditorDataModel.UpdateCounter++;
            m_Store.Update();

            IGraphModel currentGraphModel             = m_Store.GetState().CurrentGraphModel;
            Stencil     currentStencil                = currentGraphModel?.Stencil;
            bool        stencilRecompilationRequested = currentStencil && currentStencil.RecompilationRequested;

            if (stencilRecompilationRequested ||
                m_IdleTimer != null && Preferences.GetBool(VSPreferences.BoolPref.AutoRecompile) &&
                m_IdleTimer.ElapsedMilliseconds >= k_IdleTimeBeforeCompilationSeconds * 1000)
            {
                if (currentStencil && stencilRecompilationRequested)
                {
                    currentStencil.RecompilationRequested = false;
                }

                m_IdleTimer?.Stop();

                m_IdleTimer = null;
                OnCompilationRequest(RequestCompilationOptions.Default);
            }

            if (EditorApplication.isPlaying && !EditorApplication.isPaused)
            {
                m_Store.GetState().currentTracingFrame = Time.frameCount;
                m_Menu.UpdateUI();
            }
        }
        void Update()
        {
            if (m_Store == null)
            {
                return;
            }

            m_Store.GetState().EditorDataModel.UpdateCounter++;
            m_Store.Update();

            IGraphModel currentGraphModel             = m_Store.GetState().CurrentGraphModel;
            Stencil     currentStencil                = currentGraphModel?.Stencil;
            bool        stencilRecompilationRequested = currentStencil != null && currentStencil.RecompilationRequested;

            if (stencilRecompilationRequested ||
                m_IdleTimer != null && Preferences.GetBool(VSPreferences.BoolPref.AutoRecompile) &&
                m_IdleTimer.ElapsedMilliseconds >= (EditorApplication.isPlaying ? k_IdleTimeBeforeCompilationSecondsPlayMode : k_IdleTimeBeforeCompilationSeconds) * 1000)
            {
                if (currentStencil != null && stencilRecompilationRequested)
                {
                    currentStencil.RecompilationRequested = false;
                }

                m_IdleTimer?.Stop();
                m_CompilationPendingLabel.EnableInClassList(k_CompilationPendingClassName, false);

                m_IdleTimer = null;
                OnCompilationRequest(RequestCompilationOptions.Default);
            }

            m_TracingTimeline.SyncVisible();

            if (EditorApplication.isPlaying && !EditorApplication.isPaused)
            {
                m_TracingTimeline.Dirty = false;
                m_Store.GetState().currentTracingFrame = Time.frameCount;
                m_Menu.UpdateUI();
            }

            if (m_TracingTimeline.Dirty)
            {
                m_TracingTimeline.Dirty = false;
                m_Menu.UpdateUI();
            }
        }