示例#1
0
    protected bool ChangeToSubState(int type)
    {
        CState state = null;

        if (!m_mapSubState.TryGetValue(type, out state))
        {
            return(false);
        }

        if (m_subState != null)
        {
            m_subState.AfterAction();
        }
        m_subState = state;
        if (m_subState.hash != 0)
        {
            m_stateMgr.role.AnmationMgr.Play(m_subState.hash);
        }
        m_subState.PreAction();
        return(true);
    }
示例#2
0
    public bool ChangeToState(int StateType)
    {
        CState state = null;

        if (!m_mapState.TryGetValue(StateType, out state))
        {
            return(false);
        }

        if (m_state != null)
        {
            m_state.AfterAction();
        }
        m_lastState = m_state;
        m_state     = state;
        if (m_state.hash != 0)
        {
            m_life.AnmationMgr.Play(m_state.hash);
        }
        m_state.PreAction();
        return(true);
    }