Ejemplo n.º 1
0
 public void RemoveStateTransition(NPCStateTransition transitionToRemove)
 {
     if (!FWStateUtility.IsTransitionDefined(transitionToRemove))
     {
         return;
     }
     RemoveTransitionFromDictionary(transitionToRemove);
 }
Ejemplo n.º 2
0
    public void HandleTransition(NPCStateTransition transitionType)
    {
        if (!FWStateUtility.IsTransitionDefined(transitionType))
        {
            return;
        }
        NPCState newNpcState = CurrentState.GetStateFromTransition(transitionType);

        if (!FWStateUtility.IsValidNpcState(newNpcState))
        {
            return;
        }
        CurrentStateType = newNpcState;
    }
Ejemplo n.º 3
0
    public void AddStateTransition(NPCStateTransition transitionType, NPCState newState)
    {
        if (!FWStateUtility.IsTransitionDefined(transitionType) || !FWStateUtility.IsStateDefined(newState))
        {
            return; // can't be a non-existing state
        }
        // state can only move down a path, no single transition can map to multiple states (yet)

        if (TransitionExists(transitionType))
        {
            return;
        }
        StateTransitions.Add(transitionType, newState);
    }