Example #1
0
    public void DoTransition(Transition trans)
    {
        if (trans == Transition.NullTransition)
        {
            Debug.LogError("Transition is Non-Existence");
            return;
        }
        StateId id = currentState.GetState(trans);

        if (id == StateId.NullStateId)
        {
            Debug.LogWarning("Transition???");
        }
        else
        {
            FSMState state;
            stateDict.TryGetValue(id, out state);
            // 状态改变
            currentState.DoBeforeExit();
            currentState = state;
            state.DoBeforeEnter();
        }
    }