コード例 #1
0
    private void OnPlay()
    {
        m_bIsPaused = false;

        if (null == m_FileData)
        {
            return;
        }

        if (!m_bPlay)
        {
            m_bPlay    = true;
            m_ActionId = ActionManager.Instance.InsertAction(m_FileData.ID, m_FileData, m_RuntimeParam.GetRuntimeActionParam(), m_AffectedObjects);
            m_RuntimeParam.GetRuntimeActionParam().Id = m_ActionId;
        }

        ActionPlayer action = ActionManager.Instance.GetAction(m_ActionId);

        if (null == action || action.IsFinish())
        {
            return;
        }
        action.SetActionRunTime(m_fAniTimeValue);
        action.Play();
    }
コード例 #2
0
    private void OnPaused()
    {
        m_bIsPaused = true;
        ActionPlayer action = ActionManager.Instance.GetAction(m_ActionId);

        if (null == action || action.IsFinish())
        {
            return;
        }
        action.Pause();
    }
コード例 #3
0
    private void Update()
    {
        if (!m_bPlay)
        {
            return;
        }

        ActionPlayer action = ActionManager.Instance.GetAction(m_ActionId);

        if (null == action || action.IsFinish())
        {
            m_bPlay = false;
            Repaint();
            return;
        }

        m_fAniTimeValue = action.GetActionRunTime();
        Repaint();
    }
コード例 #4
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;
            }
        }
    }