示例#1
0
    public void Update()
    {
        if (null == m_lstAction || m_lstAction.Count <= 0)
        {
            return;
        }


        int nCount = m_lstAction.Count;

        for (int i = nCount - 1; i >= 0; i--)
        {
            ActionPlayer action = m_lstAction[i];

            if (null == action)
            {
                m_lstAction.RemoveAt(i);
                AddToEndPlayList(action.GetActionId());
                continue;
            }

            action.Update();

            ActionPlayer.EActionState eState = action.GetActionState();
            if (eState == ActionPlayer.EActionState.Stop)
            {
                action.Destory();
                m_lstAction.RemoveAt(i);
                AddToEndPlayList(action.GetActionId());
                continue;
            }
            if (action.IsFinish())
            {
                action.Destory();
                m_lstAction.RemoveAt(i);
                AddToEndPlayList(action.GetActionId());
                continue;
            }
        }
    }