Example #1
0
    public void HandleTransition(NPCStateTransition transitionType)
    {
        if (!FWStateUtility.IsTransitionDefined(transitionType))
        {
            return;
        }
        NPCState newNpcState = CurrentState.GetStateFromTransition(transitionType);

        if (!FWStateUtility.IsValidNpcState(newNpcState))
        {
            return;
        }
        CurrentStateType = newNpcState;
    }
Example #2
0
 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;
         }
     }
 }