protected virtual void UpdateNextState() { if (m_info.nextState == null) { if (!m_stateMgr.role.AnmationMgr.isPlaying) { AfterAction(); } } else { foreach (int type in m_info.nextState) { CState state = null; if (m_parent == null) { state = m_stateMgr.getStateByType(type); if (state != null && state.check(this)) { if (m_stateMgr.ChangeToState(type)) { return; } } } else { if (type == SUBSTATE_END) { if (!m_stateMgr.role.AnmationMgr.isPlaying) { m_parent.AfterAction(); } } else { state = m_parent.GetSubStateByType(type); if (state != null && state.check(this)) { if (m_parent.ChangeToSubState(type)) { return; } } } } } } }