public void ChangeState(Type stateType) { if (stateDic.ContainsKey(stateType)) { BaseFSM <T> fsm = stateDic[stateType]; if (fsm != null) { currentStateType = stateType; previousState = currentState; currentState = fsm; currentState.Begin(); } } }