Пример #1
0
        // issue #80. Instead of hooking step:, hook update: since it can be called by any
        // container action like Repeat, Sequence, AccelDeccel, etc..
        public override void Update(float dt)
        {
            if (dt >= m_fNextDt)
            {
                while (dt > m_fNextDt && m_uTotal < m_uTimes)
                {
                    m_pInnerAction.Update(1.0f);
                    m_uTotal++;

                    m_pInnerAction.Stop();
                    m_pInnerAction.StartWithTarget(m_pTarget);
                    m_fNextDt += m_pInnerAction.Duration / m_fDuration;
                }

                // fix for issue #1288, incorrect end value of repeat
                if (dt >= 1.0f && m_uTotal < m_uTimes)
                {
                    m_uTotal++;
                }

                // don't set an instant action back or update it, it has no use because it has no duration
                if (!m_bActionInstant)
                {
                    if (m_uTotal == m_uTimes)
                    {
                        m_pInnerAction.Update(1f);
                        m_pInnerAction.Stop();
                    }
                    else
                    {
                        // issue #390 prevent jerk, use right update
                        m_pInnerAction.Update(dt - (m_fNextDt - m_pInnerAction.Duration / m_fDuration));
                    }
                }
            }
            else
            {
                m_pInnerAction.Update((dt * m_uTimes) % 1.0f);
            }
        }
Пример #2
0
 public override void Update(float time)
 {
     m_pAction.Update(time);
 }