Ejemplo n.º 1
0
 /// <summary>
 /// 重置动画
 /// </summary>
 public void ResetToBeginning()
 {
     m_CurrentTime = 0f;
     isComplated   = false;
     for (int index = 0; index < m_AnimationPaths.Count; index++)
     {
         AnimationPath path = m_AnimationPaths[index];
         if (path != null)
         {
             path.ResetToBeginning();
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新动画
        /// </summary>
        void UpdateAnimation(float deltaTime)
        {
            if (isPause)
            {
                return;
            }

            if (!isComplated)
            {
                m_CurrentTime += deltaTime * speed;
                if (m_CurrentTime < this.m_AnimationTime)
                {
                    isComplated = false;
                }
                else
                {
                    if (this.m_Style == PlayStyle.Loop)
                    {
                        Play(0);
                    }
                    else
                    {
                        isComplated = true;
                        isPlaying   = false;
                    }
                }

                for (int index = 0; index < m_AnimationPaths.Count; index++)
                {
                    AnimationPath path = m_AnimationPaths[index];
                    if (path != null)
                    {
                        path.UpdateAnimation(m_CurrentTime);
                    }
                }
            }
        }