public ControllerStateMachine(BetterCharacterController controller) { this.controller = controller; addState(ControllerStateType.IDLE, new ControllerIdleState(this, controller)); addState(ControllerStateType.MOVING, new ControllerMovingState(this, controller)); addState(ControllerStateType.FALLING, new ControllerFallingState(this, controller)); addState(ControllerStateType.JUMPING, new ControllerJumpingState(this, controller)); CurrentState = ControllerStateType.IDLE; }
private ControllerState getState( ControllerStateType type ) { return stateMap[ type ]; }
private void addState( ControllerStateType t, ControllerState s ) { stateMap.Add( t, s ); s.ID = t; }
private ControllerState getState(ControllerStateType type) { return(stateMap[type]); }
private void addState(ControllerStateType t, ControllerState s) { stateMap.Add(t, s); s.ID = t; }