public void HandleTransition(NPCStateTransition transitionType) { if (!FWStateUtility.IsTransitionDefined(transitionType)) { return; } NPCState newNpcState = CurrentState.GetStateFromTransition(transitionType); if (!FWStateUtility.IsValidNpcState(newNpcState)) { return; } CurrentStateType = newNpcState; }
public void RemoveExistingState(NPCState stateToRemove) { if (!FWStateUtility.IsValidNpcState(stateToRemove)) { return; } for (int i = 0; i < _states.Count; i++) { if (_states[i].NpcState == stateToRemove) { _states.Remove(_states[i]); return; } } }