Exemplo n.º 1
0
        void IModuleMarsUpdate.OnMarsUpdate()
        {
            m_QueryBackend.SyncNeedsAcquireSet();

            switch (m_State)
            {
            case AcquireCycleState.UpdatesOnly:
                RunMatchUpdates();
                return;

            case AcquireCycleState.RunningSets:
            {
                GroupPipeline.OnUpdate();
                if (GroupPipeline.IsReadyForTraitDataBufferSync)
                {
                    m_Database.StopUpdateBuffering();
                }

                /*
                 *  We call RunMatchUpdates() after the check for buffering, so that on the
                 *  same frame we stop buffering, update checks can cause any events that need to happen because
                 *  of buffered data changes. This will be the frame immediately before acquire events.
                 *
                 *  We previously stopped buffering on the same frame as acquire handling, immediately after it.
                 *  We also relied on the update check the frame after acquire for query changes to propagate.
                 *  In comparison, this method has 2 less frames of latency between
                 *  buffering a change and the change's effect on proxies.
                 */
                RunMatchUpdates();

                if (!GroupPipeline.CurrentlyActive)
                {
                    m_State = AcquireCycleState.RunningStandalone;
                    StandalonePipeline.StartCycle();
                }

                break;
            }

            case AcquireCycleState.RunningStandalone:
                StandalonePipeline.OnUpdate();
                if (StandalonePipeline.IsReadyForTraitDataBufferSync)
                {
                    m_Database.StopUpdateBuffering();
                }

                RunMatchUpdates();
                if (!StandalonePipeline.CurrentlyActive)
                {
                    m_State = AcquireCycleState.UpdatesOnly;
                    OnSceneEvaluationComplete?.Invoke();
                }

                break;
            }
        }
Exemplo n.º 2
0
 internal void StartCycle()
 {
     // we run the set pipeline first, and after it's done the standalone one gets run
     m_State = AcquireCycleState.RunningSets;
     GroupPipeline.StartCycle();
 }
Exemplo n.º 3
0
 void IModuleBehaviorCallbacks.OnBehaviorEnable()
 {
     m_State = AcquireCycleState.UpdatesOnly;
 }