示例#1
0
        private void Update()
        {
            Manager m         = m_Manager;
            float   deltaTime = Time.deltaTime;
            float   timestamp = Time.unscaledTime;

            if (m != null)
            {
                m.Update(deltaTime, RoutinePhase.Update);
                if (m.Fibers.GetYieldCount(YieldPhase.WaitForUpdate) > 0)
                {
                    m.UpdateYield(deltaTime, YieldPhase.WaitForUpdate);
                }

                float thinkCustomDelta;
                if (m.AdvanceThinkUpdate(deltaTime, timestamp, out thinkCustomDelta))
                {
                    m.Update(thinkCustomDelta, RoutinePhase.ThinkUpdate);
                    if (m.Fibers.GetYieldCount(YieldPhase.WaitForThinkUpdate) > 0)
                    {
                        m.UpdateYield(thinkCustomDelta, YieldPhase.WaitForThinkUpdate);
                    }
                }

                if (m.AdvanceCustomUpdate(deltaTime, timestamp, out thinkCustomDelta))
                {
                    m.Update(thinkCustomDelta, RoutinePhase.CustomUpdate);
                    if (m.Fibers.GetYieldCount(YieldPhase.WaitForCustomUpdate) > 0)
                    {
                        m.UpdateYield(thinkCustomDelta, YieldPhase.WaitForCustomUpdate);
                    }
                }
            }
        }
示例#2
0
        private IEnumerator ApplyWaitForFixedUpdate()
        {
            while (m_Manager.Fibers.GetYieldCount(YieldPhase.WaitForFixedUpdate) > 0)
            {
                yield return(s_CachedWaitForFixedUpdate);

                m_Manager.UpdateYield(Time.deltaTime, YieldPhase.WaitForFixedUpdate);
            }
            m_WaitForFixedUpdateRoutine = null;
        }
示例#3
0
        private IEnumerator ApplyWaitForFixedUpdate()
        {
            while (true)
            {
                yield return(s_CachedWaitForFixedUpdate);

                if (m_Manager.Fibers.GetYieldCount(YieldPhase.WaitForFixedUpdate) > 0)
                {
                    m_Manager.UpdateYield(Time.deltaTime, YieldPhase.WaitForFixedUpdate);
                }
            }
        }
示例#4
0
        private void Update()
        {
            m_Manager.MarkFrameStart();

            Manager m         = m_Manager;
            float   deltaTime = Time.deltaTime;
            float   timestamp = Time.unscaledTime;

            if (m != null)
            {
                // update phase
                m.Update(deltaTime, RoutinePhase.Update);
                if (m.Fibers.GetYieldCount(YieldPhase.WaitForUpdate) > 0)
                {
                    m.UpdateYield(deltaTime, YieldPhase.WaitForUpdate);
                }

                // thinkupdate
                float thinkCustomDelta;
                if (m.AdvanceThinkUpdate(deltaTime, timestamp, out thinkCustomDelta))
                {
                    m.Update(thinkCustomDelta, RoutinePhase.ThinkUpdate);
                    if (m.Fibers.GetYieldCount(YieldPhase.WaitForThinkUpdate) > 0)
                    {
                        m.UpdateYield(thinkCustomDelta, YieldPhase.WaitForThinkUpdate);
                    }
                }

                // customupdate
                if (m.AdvanceCustomUpdate(deltaTime, timestamp, out thinkCustomDelta))
                {
                    m.Update(thinkCustomDelta, RoutinePhase.CustomUpdate);
                    if (m.Fibers.GetYieldCount(YieldPhase.WaitForCustomUpdate) > 0)
                    {
                        m.UpdateYield(thinkCustomDelta, YieldPhase.WaitForCustomUpdate);
                    }
                }

                // realtimeupdate
                float realDeltaTime = Time.unscaledDeltaTime;
                m.Update(realDeltaTime, RoutinePhase.RealtimeUpdate);
                if (m.Fibers.GetYieldCount(YieldPhase.WaitForRealtimeUpdate) > 0)
                {
                    m.UpdateYield(realDeltaTime, YieldPhase.WaitForRealtimeUpdate);
                }
            }
        }
示例#5
0
        private void LateUpdate()
        {
            Manager m         = m_Manager;
            float   deltaTime = Time.deltaTime;

            if (m != null)
            {
                m.Update(deltaTime, RoutinePhase.LateUpdate);
                if (m.Fibers.GetYieldCount(YieldPhase.WaitForLateUpdate) > 0)
                {
                    m.UpdateYield(deltaTime, YieldPhase.WaitForLateUpdate);
                }
            }
        }
示例#6
0
        private void LateUpdate()
        {
            Manager m         = m_Manager;
            float   deltaTime = Time.deltaTime;

            if (m != null)
            {
                // lateupdate
                m.Update(deltaTime, RoutinePhase.LateUpdate);
                if (m.Fibers.GetYieldCount(YieldPhase.WaitForLateUpdate) > 0)
                {
                    m.UpdateYield(deltaTime, YieldPhase.WaitForLateUpdate);
                }

                if (m_LastKnownVsync)
                {
                    m_Manager.UpdateAsync(1);
                }
            }
        }