示例#1
0
        public void UF_OnUpdate()
        {
            if (m_IsActive && !m_IsOver && !m_IsPause)
            {
                if (m_CurrentPlayClip != null && m_isPlayingElemelt)
                {
                    UF_UpdatePlayClipEvent();
                }
                else
                {
                    if (m_ListPlayQueue.Count > 0)
                    {
                        PlayQueueElemelt element = m_ListPlayQueue [0];
                        m_ListPlayQueue.RemoveAt(0);

                        m_CurrentPlayClip = element.clip;
                        m_CurrentPlayClip.playingAcitveEvent = element.triggerEvent;
                        m_CurrentPlayClip.playingCallback    = element.eventOnFinish;
                        m_CurrentPlayClip.playingSpeed       = element.speed;
                        m_CurrentPlayClip.playingParam       = element.playParam;
                        UF_PlayAnimatorClip(m_CurrentPlayClip);

                        UF_UpdatePlayClipEvent();
                    }
                    else
                    {
                        if (m_CurrentPlayClip != null && !m_isPlayingElemelt && m_CurrentPlayClip.isLoop)
                        {
                            UF_PlayAnimatorClip(m_CurrentPlayClip);
                            UF_UpdatePlayClipEvent();
                        }
                        else
                        {
                            if (m_CurrentPlayClip != null)
                            {
                                m_CurrentPlayClip.ResetPlayingState();
                                m_CurrentPlayClip = null;
                            }
                            m_IsOver = true;
                        }
                    }
                }
            }
        }