public void PerformTransition(Transition trans)
{
if (trans == Transition.None)
{
Debug.LogError("FSM ERROR: Null transition is not allowed");
return;
}
FSMStateID id = currentState.GetOutputState(trans);
if (id == FSMStateID.None)
{
Debug.LogError("FSM ERROR: Current State does not have a target state for this transition");
return;
}
currentStateID = id;
foreach (FSMState state in fsmStates)
{
if (state.ID == currentStateID)
{
currentState = state;
break;
}
}
}