void Transtion(e_combatState to) { if (CheckTranstion(to)) { m_currentState = to; } }
bool CheckTranstion(e_combatState to) { switch(m_currentState) { case e_combatState.e_init: // Init to <AnyState> is valid if( to != e_combatState.e_init) return true; break; case e_combatState.e_actionSelect: if (to == e_combatState.e_action) return true; break; case e_combatState.e_action: if ((to == e_combatState.e_resolve) ||(to == e_combatState.e_endCombat)) return true; break; case e_combatState.e_resolve: if ((to == e_combatState.e_endCombat) ||(to == e_combatState.e_actionSelect)) return true; break; case e_combatState.e_endCombat: if (to != e_combatState.e_init) return true; break; } return false; }
//e_combatState m_nextState; // Use this for initialization void Start() { m_currentState = e_combatState.e_init; }